Page 1 of 1
identify -format %[resolution.x] doesn't match %x
Posted: 2013-07-07T14:04:37-07:00
by wfzimmerman
identify -format "%x" SeedImage_9.jpg produces 72 PixelsPerInch
identify -format "[resolution.x]" SeedImage_9.jpg produces empty line.
What gives? I just want the dpi without having to parse out the unit text.
Fred
Re: identify -format %[resolution.x] doesn't match %x
Posted: 2013-07-07T14:33:01-07:00
by GreenKoopa
wfzimmerman wrote:identify -format "[resolution.x]" SeedImage_9.jpg
You were close. The fx expression should be:
identify -format "%[fx:resolution.x]" SeedImage_9.jpg
Re: identify -format %[resolution.x] doesn't match %x
Posted: 2013-07-07T15:04:37-07:00
by GreenKoopa
On second look, you were even closer. Did you forget the % (%% in Windows batch)? This is what I get on IM 6.8.5-6:
Code: Select all
> identify -format "[resolution.x]" SeedImage_9.jpg
[resolution.x]
> identify -format "%x - %[resolution.x] - %[fx:resolution.x]" SeedImage_9.jpg
72 PixelsPerInch - 72 - 72
Re: identify -format %[resolution.x] doesn't match %x
Posted: 2013-07-07T16:17:50-07:00
by wfzimmerman
Puzzler! In ImageMagick 6.5.8-9 I get
identify -format "%x - %[resolution.x] - %[fx:resolution.x]" SeedImage_9.jpg
72 PixelsPerInch - - 72
i.e. it doesn't report the middle one.
I can just use the fx option. But is this a bug?
Re: identify -format %[resolution.x] doesn't match %x
Posted: 2013-07-07T16:30:48-07:00
by GreenKoopa
A bug, but apparently fixed. Your version of IM is extremely old!
Re: identify -format %[resolution.x] doesn't match %x
Posted: 2013-07-07T17:09:28-07:00
by fmw42
Puzzler! In ImageMagick 6.5.8-9 I get
identify -format "%x - %[resolution.x] - %[fx:resolution.x]" SeedImage_9.jpg
Some string formats, such as perhaps %[resolution.x], were not available until after your release. They have grown in the number of string formats over time as new ones have been requested. You can try to use the changelog to see when things were added. See
http://www.imagemagick.org/script/changelog.php