Page 1 of 1

identify returns no resolution for TIFF generated by apple g

Posted: 2012-12-17T10:41:38-07:00
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!

Re: identify returns no resolution for TIFF generated by app

Posted: 2012-12-17T11:03:25-07:00
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.

Re: identify returns no resolution for TIFF generated by app

Posted: 2012-12-17T11:15:13-07:00
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?

Re: identify returns no resolution for TIFF generated by app

Posted: 2012-12-17T11:33:30-07:00
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.

Re: identify returns no resolution for TIFF generated by app

Posted: 2012-12-17T12:31:16-07:00
by imageboard
Thanks for the clarification!