MagickSetImageIndex() and profiles
Posted: 2014-10-29T10:23:06-07:00
For some real-world images (usually TIFFs or TIFF-like images, e.g. NEF), we find that there are multiple images in the format, e.g. a preview thumbnail as well as the main image.
For our image processing we iterate through them using MagickGetNumberImages() and MagickSetIndex() looking for the largest one, and then proceed.
However, this appears to interfere with the MagickGetImageProfile() and MagickGetImageProperties() functions, because it seems profiles are associated with specific image indexes rather than the wand as a whole. So for example all the EXIF and IPTC data may be associated with the image at index 0 whereas the main image is at index 1.
My question is, can I assume the profiles will always be associated with index 0 (as seems to be the case) or should I iterate through the indexes again looking for profiles?
(I'm using ImageMagick 6.7.7 in case this was actually a bug.)
For our image processing we iterate through them using MagickGetNumberImages() and MagickSetIndex() looking for the largest one, and then proceed.
However, this appears to interfere with the MagickGetImageProfile() and MagickGetImageProperties() functions, because it seems profiles are associated with specific image indexes rather than the wand as a whole. So for example all the EXIF and IPTC data may be associated with the image at index 0 whereas the main image is at index 1.
My question is, can I assume the profiles will always be associated with index 0 (as seems to be the case) or should I iterate through the indexes again looking for profiles?
(I'm using ImageMagick 6.7.7 in case this was actually a bug.)