Page 1 of 1

Using Magick++ to determine if an image contains multiple frames

Posted: 2015-06-11T20:17:07-07:00
by jonotrain
I am using magick++ on my website to process uploaded images. I would like to be able to test if an uploaded file contains multiple frames (whether animated or still) and to process them differently depending. What is the most efficient way to perform this test? All I could think of would be:

Code: Select all

std::list<Magick::Image> images;
readImages( &images, "uploaded file" );

if (images.size()==1) {
//process as single image
}
else {
//process multiple frames
}
Is there a more efficient way?

Re: Using Magick++ to determine if an image contains multiple frames

Posted: 2015-06-11T20:24:24-07:00
by fmw42
The equivalent of identify should list each frame and size, etc. Sorry I do not know Magick++.

I also move this topic to the Magick++ forum.

Re: Using Magick++ to determine if an image contains multiple frames

Posted: 2015-06-11T20:31:35-07:00
by jonotrain
does an equivalent function exist for magick++? I haven't found it in the documentation.

Re: Using Magick++ to determine if an image contains multiple frames

Posted: 2015-06-11T21:50:41-07:00
by dlemstra
The code from your first post is indeed the way to do it.