identify returns no resolution for TIFF generated by apple g

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
imageboard
Posts: 5
Joined: 2011-02-02T08:28:05-07:00
Authentication code: 8675308

identify returns no resolution for TIFF generated by apple g

Post by imageboard »

Hi

When identifying a TIFF image that was created by the Macs Screenshot tool grab, magick 6.8.0-10 return 0 (zero). Magick 6.7 returned correctly 72 dpi.

I used

Code: Select all

identify -format '%x %y' ~/tmp/grab.tiff 
With this file https://dl.dropbox.com/s/julx6yrvfpxahgg/grab.tiff?dl=1

Does magick now return 0 instead of the default resolution 72?

Thanks for the advice!
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: identify returns no resolution for TIFF generated by app

Post by fmw42 »

Mac OSX Snow Leopard with IM 6.8.0.10 Q16


identify grab.tiff
grab.tiff TIFF 738x814 738x814+0+0 8-bit sRGB 518KB 0.000u 0:00.009


identify -format "%x %y" grab.tiff

identify -format "%x %y" grab.tiff
0 PixelsPerInch 0 PixelsPerInch

convert grab.tiff -format "%x %y" info:
0 PixelsPerInch 0 PixelsPerInch


Does it fail with other screen snap formats? GraphicsConverter shows 72 dpi. So does Mac Preview.


Even IM identify -verbose grab.tiff seems to be missing the Resolution field!


Image: grab.tiff
Format: TIFF (Tagged Image File Format)
Class: DirectClass
Geometry: 738x814+0+0
Units: PixelsPerInch
Type: TrueColorAlpha
Base type: TrueColor
Endianess: MSB
Colorspace: sRGB
Depth: 8/16-bit
Channel depth:


I think your file was created badly and is missing the Resolution. Even exiftool is missing the resolution when run on this file. Have you tried any other screen snap tools?

It does the same for me using Grab -- no resolution field -- when I take a selection screen snap. However, if I open the tiff result in Preview and save it again to tiff, then it does include 72 dpi for the resolution and IM sees it.

So it is clearly a problem with Grab.

PS Use Preview to take your screen snaps (see screen capture under the File menu). It has similar functionality and you can save to tiff and get the resolution directly.
imageboard
Posts: 5
Joined: 2011-02-02T08:28:05-07:00
Authentication code: 8675308

Re: identify returns no resolution for TIFF generated by app

Post by imageboard »

I understand that there could be an error with images created by Grab. But what I wanted to point out is, that magick altered its behaviour here. When you run the image trough an older version, you receive the "correct" 72dpi:

identify -version
Version: ImageMagick 6.6.9-5 2011-04-21 Q16 http://www.imagemagick.org
identify -format "%x %y" grab.tiff
72 PixelsPerInch 72 PixelsPerInch

Do you think it is save to guess a 72dpi image when 6.8.0-10 magick returns 0 as resolution?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: identify returns no resolution for TIFF generated by app

Post by magick »

A resolution of 0 means the resolution is not defined. This is a result of a bug fix where a user needed to be able to distinguish between an image whose resolution is defined @ 72DPI and those whose resolution is not defined.
imageboard
Posts: 5
Joined: 2011-02-02T08:28:05-07:00
Authentication code: 8675308

Re: identify returns no resolution for TIFF generated by app

Post by imageboard »

Thanks for the clarification!
Post Reply