gif animation loop lost in conversion ?

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
coloring
Posts: 82
Joined: 2015-08-27T10:17:36-07:00
Authentication code: 1151

gif animation loop lost in conversion ?

Post by coloring »

Hello

It seems like cropping certain uncommon animated gif results in the loss of the loop
the animation will only play once then

I use the command

trimmer=`convert image.gif -coalesce -flatten -format %@ info:`
convert image.gif -coalesce -crop $trimmer +repage result.gif

anybody knows why it happens on certain gif
and is there any way to fix the loop?

thank you
Last edited by coloring on 2017-01-08T20:06:32-07:00, edited 1 time in total.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: gif animation loop lost in conversion ?

Post by fmw42 »

Your command works fine for me on IM 6.9.7.2 Q16 Mac OSX. What is your IM version and platform? Perhaps you need to upgrade.

Please always provide your IM version and platform in the future.
User avatar
GeeMack
Posts: 718
Joined: 2015-12-01T22:09:46-07:00
Authentication code: 1151
Location: Central Illinois, USA

Re: gif animation loop lost in conversion ?

Post by GeeMack »

coloring wrote: 2017-01-08T13:27:23-07:00anybody knows why it happens on certain gif
and is there any way to fix the loop?
Near the top of the page at THIS link it describes the delay and loop settings. You might be able to add "-loop 0" just before the output of your command to fix the issue...

Code: Select all

... -loop 0 output.png
coloring
Posts: 82
Joined: 2015-08-27T10:17:36-07:00
Authentication code: 1151

Re: gif animation loop lost in conversion ?

Post by coloring »

@GeeMack
Thank you so much Good Sir, once again you're spot on, you truly deserve the title of magician :D


@fmw42
thanks for the advice, I'll provide IM version next time I ask a question :)
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: gif animation loop lost in conversion ?

Post by fmw42 »

If you read my message above, you will see that it worked fine for me. I animated and looped continuously for me. No addition of -loop 0 was needed. That was why I asked you for your IM version to see if you needed an upgrade.
coloring
Posts: 82
Joined: 2015-08-27T10:17:36-07:00
Authentication code: 1151

Re: gif animation loop lost in conversion ?

Post by coloring »

i use IM 6 from jessie repository
6.8.9.9-5+deb8u6

I can't update IM freely or I wouldn't be synched with the repository anymore, which wouldn't be safe

this might be a bug in an earlier version
anyway the loop option is a great workaround so everything is fine now :)
Post Reply