Page 1 of 1

Get the Number of frames with Magick++?

Posted: 2008-04-03T02:31:49-07:00
by Tonimoro
Hi all,

I am using Magick++ and i am looking for a easy way to get the number of frames in an animated gif for example.
it seems quite easy to do when using command line ("identity -format %n") or "MagickGetNumberImages" in MagickWand api but what about magick++?

Thanks for any suggestions.

Re: Get the Number of frames with Magick++?

Posted: 2008-04-03T05:57:16-07:00
by magick
To return the number of images in a sequence use:
  • list<Image> first;
    readImages( &first, "image.gif" );
The number of images is then first.size().

Re: Get the Number of frames with Magick++?

Posted: 2008-04-04T01:23:23-07:00
by Tonimoro
Thanks, it works fine !