gifs not looping when viewed in gmerlin

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
User avatar
hellocatfood
Posts: 44
Joined: 2010-01-01T13:29:41-07:00
Authentication code: 8675309

gifs not looping when viewed in gmerlin

Post by hellocatfood »

I'm trying to diagnose a problem with another program that may be caused by a defect in imagemagick. I'm running pd extended 0.43.4 on Ubuntu 13.10. I've install gmerlin in order to play animated gifs within that program.

If I play gifs made in imagemagick they only play once and don't loop. If I play ones made in GIMP then they loop forever. What is GIMP doing that imagemagick isn't? Here is the original bug report.

Here is the original gif file http://i.imgur.com/npym0Bq.gif

For completeness I reencoded it in imagemagick http://i.imgur.com/WvBNnZ4.gif (convert originalgif.gif -coalesece images.png ; convert images*.png newgif.gif)

Here is the new gif, saved in GIMP http://i.imgur.com/51YOrMS.gif and a screenshot of the parameters I used when svaing the gif in GIMP http://i.imgur.com/ZFc4iwl.png

Can anyone help?
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: gifs not looping when viewed in gmerlin

Post by dlemstra »

I think the application is reading the file generated by ImageMagick incorrectly. We write two application extensions (http://www.matthewflickinger.com/lab/wh ... sion_block) It probably assumes both blocks contain information about the animation loop. It should check if the application identifier is NETSCAPE2.0.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: gifs not looping when viewed in gmerlin

Post by magick »

Add -loop 0 on your command-line. That tells the GIF animation to loop forever.
User avatar
hellocatfood
Posts: 44
Joined: 2010-01-01T13:29:41-07:00
Authentication code: 8675309

Re: gifs not looping when viewed in gmerlin

Post by hellocatfood »

magick wrote:Add -loop 0 on your command-line. That tells the GIF animation to loop forever.
It still only plays once in Pure Data even if I use the -loop 0 option.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: gifs not looping when viewed in gmerlin

Post by fmw42 »

Does it loop when displayed in a browser? If it does, then it sounds like a limitation of Pure Data.
User avatar
hellocatfood
Posts: 44
Joined: 2010-01-01T13:29:41-07:00
Authentication code: 8675309

Re: gifs not looping when viewed in gmerlin

Post by hellocatfood »

fmw42 wrote:Does it loop when displayed in a browser? If it does, then it sounds like a limitation of Pure Data.
Yes, they do. Time to hit the Pure Data bug reporter, then!

Is there an attribute in the gif made by GIMP that is not being set when made in imagemagick?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: gifs not looping when viewed in gmerlin

Post by fmw42 »

Is there an attribute in the gif made by GIMP that is not being set when made in imagemagick?
Are you saying that you can create an animation in GIMP that loops multiple time in Pure Data? If so, then I suspect that GIMP is doing something special. The IM developers would have to look further into this and I suggest you post this to the Developers forum to review.

Can you provide an example animation that you created in GIMP that works for you and the same one that does not work from IM so the developers can examine both to see the differences. You can upload to dropbox.com (public folder) and then put links here.
User avatar
hellocatfood
Posts: 44
Joined: 2010-01-01T13:29:41-07:00
Authentication code: 8675309

Re: gifs not looping when viewed in gmerlin

Post by hellocatfood »

fmw42 wrote:
Is there an attribute in the gif made by GIMP that is not being set when made in imagemagick?
Are you saying that you can create an animation in GIMP that loops multiple time in Pure Data? If so, then I suspect that GIMP is doing something special. The IM developers would have to look further into this and I suggest you post this to the Developers forum to review.
Bingo! The first post in this thread was a bit wordy but explains the situation.
Can you provide an example animation that you created in GIMP that works for you and the same one that does not work from IM so the developers can examine both to see the differences. You can upload to dropbox.com (public folder) and then put links here.
Certainly.

IM gif (does not loop in Pure Data) http://i.imgur.com/WvBNnZ4.gif
GIMP gif (does loop in Pure Data) http://i.imgur.com/51YOrMS.gif Preferences used when saving in GIMP http://i.imgur.com/ZFc4iwl.png
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: gifs not looping when viewed in gmerlin

Post by fmw42 »

(re-)post your IM exact IM command (if different from your earlier post) to create this gif and your version of IM and platform.
User avatar
hellocatfood
Posts: 44
Joined: 2010-01-01T13:29:41-07:00
Authentication code: 8675309

Re: gifs not looping when viewed in gmerlin

Post by hellocatfood »

fmw42 wrote:(re-)post your IM exact IM command (if different from your earlier post) to create this gif and your version of IM and platform.
From a folder full of pngs I ran

Code: Select all

convert images*.png -loop 0 newgif.gif
I'm running Imagemagick 6.7.7.10 on Ubuntu 13.10
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: gifs not looping when viewed in gmerlin

Post by fmw42 »

convert images*.png -loop 0 newgif.gif
Does it make any difference if you add a specific delay. Some viewer cannot handle an animation with zero or less than some minimum delay. Your GIF animation shows a 100 delay. But the IM animation has no delay set. You can see that from the verbose information presented by identify -verbose file.gif for each file.

try adding -delay 100 to match your GIF animation

Code: Select all

convert -delay 100 images*.png -loop 0 newgif.gif
see if that works. If so change the delay to whatever you want that is large enough not to fail on your software.

You might also explore optimizing the animation. See http://www.imagemagick.org/Usage/anim_opt/ and http://www.imagemagick.org/script/comma ... php#layers

For example

Code: Select all

convert -delay 100 images*.png -layers optimize -loop 0 newgif.gif
User avatar
hellocatfood
Posts: 44
Joined: 2010-01-01T13:29:41-07:00
Authentication code: 8675309

Re: gifs not looping when viewed in gmerlin

Post by hellocatfood »

fmw42 wrote:
convert images*.png -loop 0 newgif.gif
Does it make any difference if you add a specific delay. Some viewer cannot handle an animation with zero or less than some minimum delay. Your GIF animation shows a 100 delay. But the IM animation has no delay set. You can see that from the verbose information presented by identify -verbose file.gif for each file.

try adding -delay 100 to match your GIF animation

Code: Select all

convert -delay 100 images*.png -loop 0 newgif.gif
see if that works. If so change the delay to whatever you want that is large enough not to fail on your software.
Explicitly setting a delay worked perfectly! Even a delay of 1 still worked.

Thanks!
Post Reply