Page 1 of 3

Animated GIF doesn't work in IE

Posted: 2009-08-02T17:25:07-07:00
by gregory
Hi,

I have a web service which uses ImageMagick. Peoples create animated gifs.
Some animated gifs are okay but sometimes IM creates GIFs which work in Firefox, Opera, Chrome and doesn't work in IE.
Just first frame without animation.

Here is an example:
Image

Does somebody know what is the problem?
I tried to find the answer in Google but there is nothing I found.

I'm running: convert -loop 0 -dispose 2 -delay SPEED img*.gif result.gif

Re: Animated GIF doesn't work in IE

Posted: 2009-08-02T23:19:24-07:00
by fmw42
I am not an expert on animation nor especially on IE, but try

convert -delay SPEED img*.gif -dispose 2 -loop 0 result.gif

possibly you may need some other dispose method for IE (which IE are you using?)

Re: Animated GIF doesn't work in IE

Posted: 2009-08-03T05:43:42-07:00
by gregory
There is no difference between IE7 and IE8.

Re: Animated GIF doesn't work in IE

Posted: 2009-08-03T17:20:49-07:00
by gregory
Any ideas?
I think it's an IM bug.

Re: Animated GIF doesn't work in IE

Posted: 2009-08-03T17:51:35-07:00
by fmw42
why would it be an IM bug if it works fine in all the the other browsers?

If a bug in IM, then have you considered upgrading IM. What version is your provider using? There were some old versions of IM that had problems with animation, but it was across the boards with respect to browsers.

Your gif above works fine in my Safari, Firefox, Opera and IE 5 on my Mac

Re: Animated GIF doesn't work in IE

Posted: 2009-08-04T10:31:13-07:00
by gregory
I'm using the latest version of ImageMagick (also I tried to use 6.2 version).
I think it's a bug because IM can include some specific information in a source of image so IE can't read it and show animation properly.
Also I think it's an IM bug because there are no problem in IE with animations made in ImageReady or other software. Only when I make animation using IM.

Re: Animated GIF doesn't work in IE

Posted: 2009-08-04T10:59:36-07:00
by fmw42
but you said sometimes they work in IE and sometimes not, if I don't misunderstand. So that makes it harder to believe that it is due to IM. But I guess it could be. I shall leave this to the IM folks to confirm with you about it being a bug or not in IM.

However, if there is something special that needs to be added just for IE, I think it might help the IM folks if you could point out where to find that information.

Re: Animated GIF doesn't work in IE

Posted: 2009-08-04T14:13:04-07:00
by gregory
I can just say that I used:
Windows XP + IE 7
Windows XP + IE 8
Windows Vista + IE7
Windows Vista + IE8

You can show them this image. I've asked to check this image for about 10 peoples. Everybody said there's no animation in IE.
If you need some additional information please ask.

Re: Animated GIF doesn't work in IE

Posted: 2009-08-04T15:57:33-07:00
by magick
The question is, is this an ImageMagick bug or an IE bug? If you can prove its an ImageMagick bug, we will fix it. Since all the major browsers other than IE can animate the images we suspect its a bug in IE.

Re: Animated GIF doesn't work in IE

Posted: 2009-08-04T16:14:50-07:00
by fmw42
Nevermind, Magick has spoken.

Re: Animated GIF doesn't work in IE

Posted: 2009-08-04T23:36:28-07:00
by anthony
I would concur with Magick. I doubt it is a bug in IM I wrote (or re-wrote) most of the animation code to make sure it works correctly.

Also I would not use a value like '2' for a dispose method. What do you think '2' is?

Looking things up '2' is equivelent to 'Background' Disposal. Something that a lot of old browsers (for example Mosaic, if you were around before the 'Super-Highway') did not implement properly.

Actually NO browser implements the GIF specification properly as ALL of them actually ignores the 'background' color setting. That is because in a browser, background is really what is behind the animation, (that is 'transparency') and NOT the GIF background meta-data setting. So no one uses it, not even IM.

Also have you compared the verbose output of the ImageReady version with the IM version, it may be that IE does not handle a specific dispose method, and ImageReady avoids that method.

A good way of finding out all the animation settings being used by a GIF animation is to use the script... "gif2anim"
http://www.imagemagick.org/Usage/scripts/gif2anim
See the introduction in
http://www.imagemagick.org/Usage/anim_basics/#sequence

This reports all the IM commands that would have been used to originally build the animation, as well as seperate the animations frames AS IS, with any and all their optimizations.

Actually I recommend you read that whole section
http://www.imagemagick.org/Usage/anim_basics/
In which I tried to completely explain all aspects of GIF animations
the next section on Optimization is also a recommendation so as to understand
why a working animation can look so complex and convoluted when viewed as raw data.
http://www.imagemagick.org/Usage/anim_opt/

Re: Animated GIF doesn't work in IE

Posted: 2009-08-05T10:44:20-07:00
by gregory
I'm using "-dispose 2" for the situations when somebody wants to make an animation from images with different sizes. Am I not right?
What will you recommend? Do not use dispose or use it with other option?

Re: Animated GIF doesn't work in IE

Posted: 2009-08-05T10:52:48-07:00
by gregory
I've tried to use "-dispose none" now but it didn't help. :-(

Re: Animated GIF doesn't work in IE

Posted: 2009-08-05T15:53:30-07:00
by fmw42
try rearranging your command line as I mentioned before

convert -delay SPEED img*.gif -loop 0 result.gif


What version of IM are you using? If old, upgrade! The latest IM 6.5.4-8

Perhaps it is the original gif images you are using. Perhaps they are malformed?

Re: Animated GIF doesn't work in IE

Posted: 2009-08-05T18:04:39-07:00
by gregory
1. I'm using the latest version of ImageMagick.
2. I've tried to use different command line but it didn't help.
3. Also I've noticed that some .gif files always freeze an animation if they are in the first frame of animation. But I always change the size of photo before make animation.
I mean, how this image can be broken if I use "convert -resize" for all batch of images ane after that "convert -loop" for this resized images? So I'm using resized images made with IM. It means that IM makes broken .gif from jpg/gif/png or what? There is a big percent of broken images.

resize:
convert img.gif -resize SIZE result.gif