bug trying to retrieve file format for TIFF image

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.
Post Reply
svendecabooter
Posts: 2
Joined: 2012-11-21T01:46:07-07:00
Authentication code: 6789

bug trying to retrieve file format for TIFF image

Post 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
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: bug trying to retrieve file format for TIFF image

Post 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.
snibgo's IM pages: im.snibgo.com
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: bug trying to retrieve file format for TIFF image

Post by magick »

Formatting is under user control. Add a space in your format argument, i.e. -format "%m ".
svendecabooter
Posts: 2
Joined: 2012-11-21T01:46:07-07:00
Authentication code: 6789

Re: bug trying to retrieve file format for TIFF image

Post 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
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: bug trying to retrieve file format for TIFF image

Post 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.
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: bug trying to retrieve file format for TIFF image

Post 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"
Post Reply