Determine if .gif is animated from c++ api

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
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Determine if .gif is animated from c++ api

Post by magick »

Use STL. The image list begin() / end() tells you the length of the animation. If its 1 its not an animation:
  • #include <list>
    ...
    list<Image> imageList;
    readImages( &imageList, "test_image_anim.gif" );
    ...
    cout << imageList.begin() << endl;
    cout << imageList.end() << endl;
Post Reply