Support for Animated Gifs ?

Sep 30, 2009 at 12:58 PM

Hello, 

i tried to load an animated GIF with the animatedImage control. I downloaded the image from the link bellow and place it in the images directory of ImageTools.Demo.Loading project

http://astrogeology.usgs.gov/Gallery/MoviesAndAnimations/media/borrelly.gif

<it:AnimatedImage x:Name="Image" Source="Images/borrelly.gif" OpacityMask="{x:Null}"/>

 

I got the following exception:

 

Message: ImageTools.IO.UnsupportedImageFormatException: Exception of type 'ImageTools.IO.UnsupportedImageFormatException' was thrown.

at ImageTools.Image.DoLoad(Stream stream)

at ImageTools.Image.<Load>b__12(Object x)

at System.Threading._ThreadPoolWaitCallback.WaitCallback_Context(Object state)

at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)

at System.Threading._ThreadPoolWaitCallback.PerformWaitCallbackInternal(_ThreadPoolWaitCallback tpWaitCallBack)

at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback(Object state)  

 

What wrong with this ?

Thank you 

 

Francisco

Coordinator
Sep 30, 2009 at 1:19 PM
Edited Sep 30, 2009 at 1:20 PM

You have forgotten to register the GifDecoder,I have written a short article because many people have the same problem http://imagetools.codeplex.com/Wiki/View.aspx?title=Working%20with%20different%20image%20formats

Sep 30, 2009 at 5:48 PM
Edited Sep 30, 2009 at 5:54 PM

 

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; InfoPath.2; .NET CLR 3.5.21022; .NET CLR 3.0.30618; .NET CLR 3.5.30729; MS-RTC LM 8)
Timestamp: Wed, 30 Sep 2009 15:52:36 UTC
Message: Unhandled Error in Silverlight Application 
Code: 4004    
Category: ManagedRuntimeError       
Message: System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at ImageTools.IO.Gif.LZWDecoder.DecodePixels(Int32 width, Int32 height, Int32 dataSize)
   at ImageTools.IO.Gif.GifDecoder.ReadFrame()
   at ImageTools.IO.Gif.GifDecoder.Decode(Image image, Stream stream)
   at ImageTools.Image.DoLoad(Stream stream)
   at ImageTools.Image.<Load>b__12(Object x)
   at System.Threading._ThreadPoolWaitCallback.WaitCallback_Context(Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallbackInternal(_ThreadPoolWaitCallback tpWaitCallBack)
   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback(Object state)     
Line: 54
Char: 13
Code: 0
URI: file:///C:/Users/Francisco.UBISIGN.000/Documents/Visual%20Studio%202008/Projects/Silverlight/imagetools-29686/Source/ImageTools/ImageTools.Demo.Loading/Bin/Debug/TestPage.html

Hello, 

thank you for the prompt response. I did as you suggested and it solved the problem.

I am now facing a new one. I loaded some .gif files that are available here

http://i702.photobucket.com/albums/ww27/franxico_bucket/hd1.gif

http://i702.photobucket.com/albums/ww27/franxico_bucket/Apollo13.gif

http://i702.photobucket.com/albums/ww27/franxico_bucket/Batuta.gif


They have been generated with NGif ( http://www.codeproject.com/KB/GDI-plus/NGif.aspx ) with default parameters (delay = 500 ms, repeatable ). 

 I used ImageTools.Demo.Loading project to load them and the following exception arose.

 

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; InfoPath.2; .NET CLR 3.5.21022; .NET CLR 3.0.30618; .NET CLR 3.5.30729; MS-RTC LM 8)

Timestamp: Wed, 30 Sep 2009 15:52:36 UTC

 

Message: Unhandled Error in Silverlight Application

Code: 4004

Category: ManagedRuntimeError

Message: System.IndexOutOfRangeException: Index was outside the bounds of the array.

at ImageTools.IO.Gif.LZWDecoder.DecodePixels(Int32 width, Int32 height, Int32 dataSize)

at ImageTools.IO.Gif.GifDecoder.ReadFrame()

at ImageTools.IO.Gif.GifDecoder.Decode(Image image, Stream stream)

at ImageTools.Image.DoLoad(Stream stream)

at ImageTools.Image.<Load>b__12(Object x)

at System.Threading._ThreadPoolWaitCallback.WaitCallback_Context(Object state)

at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)

at System.Threading._ThreadPoolWaitCallback.PerformWaitCallbackInternal(_ThreadPoolWaitCallback tpWaitCallBack)

at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback(Object state)

 

Line: 54

Char: 13

Code: 0

 

Can you provide me some help on this ?

Thank you,

Francisco

 

 

Coordinator
Oct 2, 2009 at 4:01 PM
Thx, this is a real bug, I will care about it :)
Oct 2, 2009 at 4:47 PM

Btw, do you know any alternative way of building animated gifs in order to prevent the bug ?

Coordinator
Oct 4, 2009 at 8:49 PM

No, but I can tell you, that the bug is fixed now :)

Nov 2, 2009 at 2:32 PM

Hello Malignate, 

do you anticipate any dates for the release of 0.2 version ? 

Regards,

Francisco

Coordinator
Nov 3, 2009 at 10:51 PM
I want to have a full working gif encoder in version 0.2, but I dont
have no time at the moment. Nobody is willing to help me and I think I
can release version 0.2 in january first. I am in panama and costa rica
from end of november up to the first week of january, so I cannot make
any progress in this days.