Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
The expected behavior would be for index 0 to extract the first page of the tiff out. Instead, it copies the image. The expected behavior for index 1 .. whatever is for it to extract that specific page. That does work properly.
When the input tiff contains two images, this should create one output tiff file that contains those two images. The output file will be named "a0.tif".
When the input tiff contains two images, this should create one output tiff file that contains those two images. The output file will be named "a0.tif".
It is impossible to extract both images from the tiff into separate images. You can extract [0, 1] into one image, and [1] into another image, but not [0].
locriani wrote:It is impossible to extract both images from the tiff into separate images. You can extract [0, 1] into one image, and [1] into another image, but not [0].
locriani wrote:It is impossible to extract both images from the tiff into separate images. You can extract [0, 1] into one image, and [1] into another image, but not [0].
It appears to affect all the images we have had uploaded (generally created in Photoshop or NedGraphics), but not the example generated by imagemagick you just posted.
The subfile is there, I assure you.
As per the TIFF spec:
There may be more than one IFD in a TIFF file. Each IFD defines a subfile. One potential use of subfiles is to describe related images, such as the pages of a facsimile transmission. A Baseline TIFF reader is not required to read any IFDs beyond the first one.
Photoshop is not required to read any additional subfiles. However, the first subfile is the canonical image in this case. ImageMagick is incapable of extracting the canonical image from this TIFF representation.
It's another TIFF format extension that implements paging support, as in PDFs. ImageMagick handles that case correctly, but not the subfile case correctly.
As you can see, the 2 images in this file are different sizes (and have different colors). It is possible to extract image[1], but not the image[0]. Instead, you extract image[0, 1] (basically copying the image), which is not useful.
You have found a feature that was added last year. The first image has a resource block that contains layer information. Extracting one of the layers is possible as you have seen. But you cannot 'only' get the first image because the second image (layer) is part of the first image. You can disable this feature with the following define: