Multipage Tiff Extraction Functions Incorrectly

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.
locriani
Posts: 13
Joined: 2016-08-20T00:01:48-07:00
Authentication code: 1151

Re: Multipage Tiff Extraction Functions Incorrectly

Post by locriani »

dlemstra wrote: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:

Code: Select all

D:\>identify -define tiff:ignore-layers=true c6f95170d8a5aebb1ee7e32bf52325b7.tif
c6f95170d8a5aebb1ee7e32bf52325b7.tif TIFF 1013x325 1013x325+0+0 8-bit CIELab 232KB 0.000u 0:00.000
I see, that's really unfortunate. Thanks for the info, it's helped me debug further causes for this issue.

It is, however, frustrating that ImageMagick doesn't have a way strip the tags specifying the layer data, as the first image block without the tag data is how Adobe intends for the image to be read outside of the context of Photoshop (at least, according to their spec).
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Multipage Tiff Extraction Functions Incorrectly

Post by fmw42 »

dlemstra wrote:-define tiff:ignore-layers=true
I tried this and wrote only layer [0] and only layer [1], but when I do identify on the saved image from layer [0], it still had two layers showing and looked like the original. The layer [1] seemed fine and identify showed only one layer.

So I am not sure that this define is meant to do.
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: Multipage Tiff Extraction Functions Incorrectly

Post by dlemstra »

The option means that it will not try to read them and add them to the 'list of images', it will still remain in the file though. You can remove the layers by removing the profile with the name 'tiff:37724'. The following will get you only the first image:

Code: Select all

convert c6f95170d8a5aebb1ee7e32bf52325b7.tif[0] +profile "tiff:37724" test.tiff
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Multipage Tiff Extraction Functions Incorrectly

Post by fmw42 »

Great. Thanks Dirk!
Post Reply