Page 2 of 3
Re: Animated GIF doesn't work in IE
Posted: 2009-08-05T18:32:11-07:00
by fmw42
Do you do the resize in the same command line as making the animation? If so can you provide your exact command line or set of command lines.
I think you have to figure out why the gif won't display after (or before) you resize it. Something seems wrong with your original gif or jpg or whatever images you are converting to gif. Are any of them CMYK for example? You need to find the common factor for what is wrong with the images you start with for the ones that don't display.
Then again, I don't see why they don't work on IE if they work fine on other browsers. The animation file is the same. Therefore, it seems that IE is the problem and has special requirements that are not clear to anyone in order for the files to animate. You need to google animated gifs on IE and see if others are having a problem or if others have a solution or know what special needs IE requires.
Just some thoughts as I really have no clue.
How are the files displayed in IE? Are they displayed by simply dragging and dropping, by open, or by some API such as PHP. If this is on a server, then perhaps the server environment is not proper.
Again just thinking out loud trying to find some common denominator and to understand the full environmental aspects of your problem.
Re: Animated GIF doesn't work in IE
Posted: 2009-08-05T18:45:28-07:00
by fmw42
I did identify -verbose anim.gif from the animation on your first posting. I see that each gif is LZW compressed. Perhaps IE does not like LZW compression.
try -compress none
http://www.imagemagick.org/script/comma ... p#compress
The other issue is perhaps the colormaps for the frames are not consistent and so perhaps IE cannot handle that.
see -remap
http://www.imagemagick.org/script/comma ... .php#remap
There are also some properties in the verbose information being carried with your frames. For examples the first frame says:
Properties:
comment: CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), quality = 85
date:create: 2009-08-05T18:33:52-07:00
date:modify: 2009-08-05T18:33:52-07:00
signature: e3ad14c8e28b332b1c314986a5a175fabf8753c7e8dcd7cbba2efdddeadd2feb
Thus it looks like it was created with GD and NOT IM.
You may want to strip this information, if that is possible, using -strip
convert anim.gif -strip anim2.gif
That seems to have removed the
comment: CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), quality = 85
See if that helps.
At this point I am out of ideas.
Re: Animated GIF doesn't work in IE
Posted: 2009-08-05T22:40:52-07:00
by anthony
gregory wrote: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?
A GIF animation uses the Virtual canvas (typically the real size) of the first image to determine the output size of the animation.
When images are different sizes each frame 'overlays' only a smaller set of pixels on what was left afetr the previous frame was 'disposed'. When all frames of an animation is either 'background' dispose or 'previous' dispose, the animation will always clear the frame completely (to transparency) before overlaying the next frame.
In 'Previous' it uses last non-previous dispose content, which is the empty frame, in 'background' disose the area overlaied is cleared, as as that was the only thing being shown it again clears back to a empty display.
I call this a 'Cleared Frame Animation'.
http://www.imagemagick.org/Usage/anim_basics/#cleared
As I said if all the frames only use previous or background dispose this is the type of animation you get, where exact frame is the complete image that is shown at that point, no more, no less. As such you can use either all previous '3' or all background '2' disposals (or any mix of such) for such an animation.
It is only when an animation also has none '1' or 'undefined '0' disposals involved that an animation does not get completely cleared to transparency, but may leave behind non-transparent pixels from previous frames.
What does "ImageReady" do to keep IE happy? As fred mentioned your example is from GD, and only havs two images that are the same size, as such disposal really does not matter as you overlay the image completely each time.
That is your example was a Coalesced Animation
http://www.imagemagick.org/Usage/anim_basics/#coalesced
without any transparency or disposal requirment at all!
And read the IM Examples Animations Basics!!!!!
Re: Animated GIF doesn't work in IE
Posted: 2009-08-06T05:10:39-07:00
by gregory
Yes, the problem is definately in this "CREATOR: gd-jpeg v1.0" comment.
I've checked animation which freezes in IE and they have this comment.
I'm not using RESIZE nad LOOP in one command line. For example, I have 3 images.
1. convert /path/to/sourcefile1.jpg -size 300 /path/to/finalimage1.gif
2. convert /path/to/sourcefile2.jpg -size 300 /path/to/finalimage2.gif
3. convert /path/to/sourcefile3.jpg -size 300 /path/to/finalimage3.gif
4. convert -loop 0 -delay 50 /path/to/finalimage*.gif /path/to/animation.gif
I'm NOT using GD anywhere!
Re: Animated GIF doesn't work in IE
Posted: 2009-08-06T09:31:12-07:00
by fmw42
But where did your original (jpg) images come from, perhaps some GD processing and that was kept in the header which got moved to IM.
Did -strip help?
Also I keep telling you to move -loop 0 to the end
convert -delay 50 images*.xxx -loop 0 animation.gif
Or strip the GD in your resize
convert image.jpg -strip -resize 300 image.gif
Re: Animated GIF doesn't work in IE
Posted: 2009-08-06T09:49:46-07:00
by gregory
Hi again,
"-strip" & "-loop" at the end didn't help.
"GD comment" has dissappeared in verbose but there is still no animation.
Here is verbose information on the image (frame 1 in animation) which freezes an animation. It's before resizing:
Image: frame1.jpg
Format: JPEG (Joint Photographic Experts Group JFIF format)
Class: DirectClass
Geometry: 620x385+0+0
Resolution: 72x72
Print size: 8.61111x5.34722
Units: PixelsPerInch
Type: TrueColor
Endianess: Undefined
Colorspace: RGB
Depth: 8-bit
Channel depth:
red: 8-bit
green: 8-bit
blue: 8-bit
Channel statistics:
red:
min: 6 (0.0235294)
max: 255 (1)
mean: 218.272 (0.855968)
standard deviation: 22.0198 (0.0863521)
kurtosis: 8.40136
skewness: -2.33604
green:
min: 0 (0)
max: 254 (0.996078)
mean: 204.309 (0.801213)
standard deviation: 28.0211 (0.109887)
kurtosis: 4.73215
skewness: -1.84953
blue:
min: 0 (0)
max: 251 (0.984314)
mean: 197.003 (0.772561)
standard deviation: 30.8057 (0.120807)
kurtosis: 3.67944
skewness: -1.66799
Image statistics:
Overall:
min: 0 (0)
max: 255 (1)
mean: 154.896 (0.607436)
standard deviation: 92.7941 (0.363899)
kurtosis: -0.892445
skewness: -0.955059
Rendering intent: Undefined
Interlace: JPEG
Background color: white
Border color: rgb(223,223,223)
Matte color: grey74
Transparent color: black
Page geometry: 620x385+0+0
Dispose: Undefined
Iterations: 0
Compression: JPEG
Quality: 80
Orientation: Undefined
Properties:
comment: CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), quality = 85
date:create: 2009-08-06T11:01:26-05:00
date:modify: 2009-08-06T11:44:59-05:00
jpeg:colorspace: 2
jpeg:sampling-factor: 2x2,1x1,1x1
signature: 92c36f586537630113df64d0da2c2d539c46f8696ce5404ac3455a22c1699516
Artifacts:
verbose: true
Tainted: False
Filesize: 18.3kb
Number pixels: 233kb
Version: ImageMagick 6.5.4-7 2009-08-05 Q16 OpenMP
http://www.imagemagick.org
Re: Animated GIF doesn't work in IE
Posted: 2009-08-06T09:55:17-07:00
by gregory
Please, download this frames:
http://buynewproduct.com/tmp/frame1.jpg
http://buynewproduct.com/tmp/frame2.jpg
I used "convert -delay 50 frame1.jpg frame2.jpg -loop 0 result.gif" command line with this images.
Result image has no animation in IE 7,8.
Maybe you can find the reason?
Re: Animated GIF doesn't work in IE
Posted: 2009-08-06T18:38:46-07:00
by fmw42
Before I spend too much time, I see that both images have
comment: CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), quality = 85
in the file.
So try the following and let us know if that helps
convert -delay 50 frame1.jpg frame2.jpg -strip -loop 0 result.gif
Re: Animated GIF doesn't work in IE
Posted: 2009-08-06T19:01:48-07:00
by gregory
I said that I tried "-strip". I've tried one more time like you said -- no animation in IE.
Re: Animated GIF doesn't work in IE
Posted: 2009-08-06T19:10:23-07:00
by anthony
gregory wrote:Yes, the problem is definately in this "CREATOR: gd-jpeg v1.0" comment.
I've checked animation which freezes in IE and they have this comment.
I'm not using RESIZE nad LOOP in one command line. For example, I have 3 images.
1. convert /path/to/sourcefile1.jpg -size 300 /path/to/finalimage1.gif
2. convert /path/to/sourcefile2.jpg -size 300 /path/to/finalimage2.gif
3. convert /path/to/sourcefile3.jpg -size 300 /path/to/finalimage3.gif
4. convert -loop 0 -delay 50 /path/to/finalimage*.gif /path/to/animation.gif
I'm NOT using GD anywhere!
What is the -size for? First it is incomplete, second it would not effect anything.
If you put it before the JPG file read, then it would provide a size hint to JPEG, so limit reading to an image slightly larger than the size give (not the size hint itself).
Also you do not specify ANY disposal method, so if the JPG images are differnet sizes you will just overlay the new images over the old ones!
Re: Animated GIF doesn't work in IE
Posted: 2009-08-06T19:19:39-07:00
by anthony
Try changing the order of the JPEG images. Does it always 'hang' on the first image, or only on a specific image.
Also the two images are NOT the same size, as such you need to tell IM how big to make the virtual canvas for the animation!!!!
Code: Select all
convert -delay 50 -page 620x403 -dispose background \
frame1.jpg frame2.jpg -loop 0 result.gif
IE may be hanging because the second image is larger than the first and as such overflows the virtual canvas (set to teh size of the first image) of the animation.
Swapping the two images should also fix that problem!
Finally as the canvas is larger than the first image you may like to re-porition that image so it is more centered on that canvas. Eg offset the first image by (403-375)/2 => 9 pixels.
Code: Select all
convert -delay 50 -page 620x403 -dispose background \
-page +0+9 frame1.jpg \
-page +0+0 frame2.jpg \
-loop 0 result.gif
this by the way is starting to look like the 'gif2anim' script output I talk about in
IM Examples, Basics, Animation Sequence Information
http://www.imagemagick.org/Usage/anim_basics/#sequence
Read your basics!!!
PS: the latest Firefox v3 under linux has a bug which shows 'black' areas in 'paged' GIF animations. I have reported this, and even had it confirmed by another user, but the developers have not acknowledged this bug. This problem did not exist in FireFox v2, Netscape, Mozilla or any IE I tried over the years.
Re: Animated GIF doesn't work in IE
Posted: 2009-08-07T06:58:56-07:00
by gregory
So should I write "-page WxH" of the biggest frame in a batch?
Is it possible to crop the animation to the dimensions of the first frame?
Also I need to say that "-page WxH" solved the problem! But I'm still interesting in questions above.
Thank you very much for your help!
Re: Animated GIF doesn't work in IE
Posted: 2009-08-07T10:42:32-07:00
by fmw42
Anthony is the expert, but I don't see any reason you cannot crop your images to the same size
convert -delay XXX image1 image2 image3 ... -crop $dimensions +repage -loop 0 animation.gif
you would have to loop through each image to find the dimensions of the largest image in the group first and then set up a variable for dimensions=WxH+X+Y
or if you want to crop in the middle use
convert -delay XXX image1 image2 image3 ... -gravity center -crop $dimensions +repage -loop 0 animation.gif
were dimensions=WxH+0+0
Re: Animated GIF doesn't work in IE
Posted: 2009-08-07T12:45:29-07:00
by gregory
Thanks.
I've fixed my script and have added a new cycle which finds biggest dimensions.
Then I'm using this command line:
convert -delay DELAY -page WxH -dispose background /path/to/images*.gif -loop 0 /path/to/animation.gif
It works great!
Maybe you better to add this problem of IE in the manual/FAQ? I couldn't expect it because I use Firefox/Opera/Chrome.
Re: Animated GIF doesn't work in IE
Posted: 2009-08-07T20:00:23-07:00
by anthony
Okay so now we know IE will fail and lock up if one of the image frames is larger than the drawing 'virtual' canvas of the animation.
Try downloading and look at my example from
http://www.imagemagick.org/Usage/anim_m ... e_relative
Specifically the animation...
http://www.imagemagick.org/Usage/anim_m ... offset.gif
In this example all the frames are smaller than the canvas size, but two of the frames are positioned so the image draws beyond the 'virtual canvas'.
It would be a great help to know if this example also has such a problem.
I can then add warnings and comments about this in a number of places in IM Examples for others.