Page 1 of 1

bug trying to retrieve file format for TIFF image

Posted: 2012-11-21T01:59:19-07:00
by svendecabooter
I am trying to retrieve the file format for a bunch of TIFF images via the following command:

Code: Select all

/usr/bin/identify -format "%m" [FILENAME]
This works for most of the TIFF images I have, but some files give output as following:
identify: dadizele40.tiff: unknown field with tag 317 (0x13d) encountered. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/704.
identify: dadizele40.tiff: unknown field with tag 34391 (0x8657) encountered. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/704.
identify: dadizele40.tiff: unknown field with tag 34392 (0x8658) encountered. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/704.
identify: incorrect count for field "Tag 34391" (0, expecting 1); tag ignored. `dadizele40.tiff' @ warning/tiff.c/TIFFWarnings/704.
identify: incorrect count for field "Tag 34392" (0, expecting 1); tag ignored. `dadizele40.tiff' @ warning/tiff.c/TIFFWarnings/704.
identify: dadizele40.tiff: unknown field with tag 317 (0x13d) encountered. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/704.
TIFFTIFF
I guess the warnings are not good, but the fact that the file format output is "TIFFTIFF" breaks my scripts :/

I am using Debian Linux with the following ImageMagick version:
Version: ImageMagick 6.6.0-4 2012-05-02 Q16

I'm no ImageMagick expert, but searching around the net didn't return much useful results, so I'm trying here with the experts :)

Link to the file that's giving problems: http://bit.ly/Sa0ssk

Re: bug trying to retrieve file format for TIFF image

Posted: 2012-11-21T05:03:00-07:00
by snibgo
The file contains two images, each of type "TIFF". It would seem sensible (to me) if IM separated the types with a space or something.

Re: bug trying to retrieve file format for TIFF image

Posted: 2012-11-21T05:07:30-07:00
by magick
Formatting is under user control. Add a space in your format argument, i.e. -format "%m ".

Re: bug trying to retrieve file format for TIFF image

Posted: 2012-11-21T05:35:44-07:00
by svendecabooter
Hmm strange... how can 1 file contain 2 images?
I only see 1 in all the programs I open the file with.
How did you find out?

Sven

Re: bug trying to retrieve file format for TIFF image

Posted: 2012-11-21T06:50:58-07:00
by snibgo
I just used:

Code: Select all

identify dadizele40.tiff
which lists two images, then has a few warnings and one error:

Code: Select all

identify.exe: dadizele40.tiff: Null count for "Tag 34391" (type 1, writecount -3, passcount 1). `_TIFFVSetField' @ error/tiff.c/TIFFErrors/561.
Despite the error, convert can extract both images. One seems to be a thumbnail of the other. Gimp also shows two images.

Some file formats can contain many images. These include XCF, TIFF, AVI, MOV and GIF.


Thanks, magick, the space in the format does the trick.

Re: bug trying to retrieve file format for TIFF image

Posted: 2012-11-21T11:10:37-07:00
by fmw42
magick wrote:Formatting is under user control. Add a space in your format argument, i.e. -format "%m ".
You might prefer to put them on multiple lines by using "%m\n"