This project is read-only.

JpegDecoder DLL in Phone Bin

Jun 20, 2011 at 12:52 PM

Anyone know how to add the JpegDecoder to a Windows Phone 7 project? By default in the Phone Bin folder there are Bmp, Gif and Png DLLs, but there is no Jpeg DLL? I have a project with an absolute UriSource on the web and won't know if the image is GIF, PNG or JPEG until after it's loaded. The PNG and GIF files work perfectly, but the JPG files don't display using AnimatedImage.

Here are the decoder statements at the top of the page:

ImageTools.IO.Decoders.AddDecoder<BmpDecoder>();
ImageTools.IO.Decoders.AddDecoder<GifDecoder>();
ImageTools.IO.Decoders.AddDecoder<PngDecoder>();

Here is my code for setting the image to the AnimatedImage:

AnimatedImage animatedImage = new AnimatedImage();
animatedImage.Source = new ExtendedImage();
animatedImage.Source.UriSource = new Uri(stringURL, UriKind.Absolute); //stringURL is a web URL to an image. There is no extension in the URL to determine if it is PNG, GIF or JPG ahead of time

Thanks

Coordinator
Jun 20, 2011 at 12:59 PM
The jpeg decoder is part of the current version. Just download the
source code. I will prepare a package the next days.
Jun 20, 2011 at 2:46 PM

Awesome! I'll wait for the package to get the compiled DLLs.

Thanks!

Dec 20, 2011 at 8:18 AM

Hello, I need the jpeg encoder for WP7. Could someone please send me the DLL's from the latest source code? I've tried to compile it by myself, but it has not worked.

Feb 12, 2014 at 8:59 AM
I only used jpeg 2000 decoder on windows computer, as for jpeg reader DLL in Phone, I can't help having a test. Can you give some suggest and offer a free tool?
Developer
Feb 19, 2014 at 3:32 AM
You don't need to use the jpeg decoder for Windows Phone; you can use the built in method PictureDecoder.DecodeJpeg(stream) as per here to get a WriteableBitmap, then use the helper method ToImage() to get an ExtendedImage from that.