Re: [GM-help] Using identify to get the resolution
Swiss army knife of image processing
Brought to you by:
bfriesen
From: Bob F. <bfr...@si...> - 2004-06-24 19:36:20
|
On Thu, 24 Jun 2004, Paul Pritchard wrote: > Hi guys. > > I'm trying to identify to determine the resolution of GIF and JPG > files, using commands like this: > > gm identify filename -format %x > gm identify filename -format %y > > Out of 572 files I tested, this returned a value on only 74 files > (about 13%). If I right-click on one of these in Windows Explorer > and select Properties, it does show the resolution. Not all images have a resolution setting. Probably Windows Explorer is inserting a default if the image doesn't otherwise contain a resolution. This could be 72 (one typesetting point per pixel) or the Windows display resolution (which probably depends on whether small or large fonts have been selected in Windows display setup). > My question is this: why does identify not get the resolution on > some files? Am I doing something wrong? Is there some alternate > technique I should be using? Raster images don't inherently have a resolution. The notion of resolution is to support typesetting so that the viewing/printing size may be expressed independent from the number of actual pixels in the image. The DTP user doesn't need to know the number of pixels in the image if the image has a "resolution". If the image is 72 DPI and the screen resolution is 72 DPI, then an image 72 pixels wide takes one inch of display width. We could have GraphicsMagick return a default (e.g. 72, or a value which displays the image in a given area on a typical computer display), but that may hurt much more than it helps since it would be a lie. > Using version 1.0.2. Very old! Has known bugs! Please update. :-) Bob ====================================== Bob Friesenhahn bfr...@si... http://www.simplesystems.org/users/bfriesen |