Jaime Rodriguez On Windows Phone, Windows Presentation Foundation, Silverlight and Windows 7
As you know, Silverlight does not have native support for decoding gif images. That is downer, but not a showstopper since several 3rd party, opensource libraries for decoding Gifs.
The Twitter for Windows Phone team used the ImageTools project from Codeplex to decode gifs. It worked well, but when we implemented there were two things that bothered me a little:
I knew there were other libraries and partners were using these (for example, the GifDecoder library shared a long while ago by Joe Stegman). Today, I finally compared these two libs side-by-side. I used ~400 images. 25% came from a list of Gifs that had known issues. The other 75% was a random selection by looking at a Twitter user, and downloading his followers and filtering for the ones that used gifs.
The results: Decoding wise, these two libraries are pretty much the same code. I should have started by comparing that before I wrote my test. Instead, I found it by accident as I dived in to fix the infinite loop above. The results are pretty inline with our original ~90% assessment. My tests are a bit lower but again it is because I spiked the test. The codeplex library is getting updated a lot more, and is growing and getting fixes, so that is what I am sticking with for my projects. They have done a lot of work on their AnimatedImage control (which supports animated gifs, looks pretty neat (though I have to say animated gifs feels like going back in time). If you need to decode Gifs, I do recommend you use this library. It is better than nothing. Please do make sure you:
I am sure the library will improve over time, I pinged the folks with my tests and my results in case it helps improve. Source for my little test, and source for the libraries I used (with small changes) are in skydrive
Happy Windows Phone coding!