This project is read-only.

Seeing a number of exceptions decoding jpegs

Mar 27, 2011 at 5:06 AM

I've included the jpeg decoder in a recent wp7 project and I'm seeing rough performance. I think the cause is the number of exceptions being thrown. 

A first chance exception of type 'System.IO.EndOfStreamException' occurred in ImageTools.IO.Jpeg.dll
A first chance exception of type 'FluxJpeg.Core.IO.JPEGMarkerFoundException' occurred in ImageTools.IO.Jpeg.dll

I see a large number of these when I try to batch process a number of images. I took a brief look at the code and it looks like they are being thrown to control program flow?

 

ImageTools is awesome btw. Thanks for putting this out there.

Apr 15, 2011 at 1:20 PM

I have not implemented the jpeg decoder myself, so I am not familiar with all lines of the jpeg stuff.

Can you load all images?

Feb 22, 2014 at 6:18 PM
Edited Feb 22, 2014 at 6:19 PM
Use JpegDecoderNano instead.
Feb 26, 2014 at 3:06 AM
Use the built in method PictureDecoder.DecodeJpeg(stream) to get a WriteableBitmap, then use the helper method ToImage() to get an ExtendedImage from that.