Image which has multiple frames
Image which has multiple frames
Is there any direct Image attribute which will tell me programtically whether a particular image consists of multiple frames or not ? I am dealing with GIF images and want to determine whether or not a GIF is a single frame image or a multi-frame GIF animation.
Re: Image which has multiple frames
My OP said programatically. You have given me a command line.seanburke1979 wrote:identify -format "%[fx:n]" myfile.gif
-
- Posts: 1015
- Joined: 2005-03-21T21:16:57-07:00
Re: Image which has multiple frames
If you're using MagickWand and have read the GIF in to a wand, this will return the number of frames:
f_num = MagickGetNumberImages(m_wand);
Pete
f_num = MagickGetNumberImages(m_wand);
Pete
Re: Image which has multiple frames
I am using Magick++. What I decided to do was simply to read in the image originally, using Magick++, as if it could contain frames and I could determine from this how many frames are in the image from the size of the std::vector<Image>. If it were a single frame image I could then subsequently using just the single frame Image while if it were mutiple frames I had to use std::vector<Image> to manipulate the frames.el_supremo wrote:If you're using MagickWand and have read the GIF in to a wand, this will return the number of frames:
f_num = MagickGetNumberImages(m_wand);
Pete