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
identify -format %[resolution.x] doesn't match %x
-
- Posts: 8
- Joined: 2013-04-17T11:31:14-07:00
- Authentication code: 6789
- GreenKoopa
- Posts: 457
- Joined: 2010-11-04T17:24:08-07:00
- Authentication code: 8675308
Re: identify -format %[resolution.x] doesn't match %x
You were close. The fx expression should be:wfzimmerman wrote:identify -format "[resolution.x]" SeedImage_9.jpg
identify -format "%[fx:resolution.x]" SeedImage_9.jpg
- GreenKoopa
- Posts: 457
- Joined: 2010-11-04T17:24:08-07:00
- Authentication code: 8675308
Re: identify -format %[resolution.x] doesn't match %x
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
-
- Posts: 8
- Joined: 2013-04-17T11:31:14-07:00
- Authentication code: 6789
Re: identify -format %[resolution.x] doesn't match %x
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?
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?
- GreenKoopa
- Posts: 457
- Joined: 2010-11-04T17:24:08-07:00
- Authentication code: 8675308
Re: identify -format %[resolution.x] doesn't match %x
A bug, but apparently fixed. Your version of IM is extremely old!
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: identify -format %[resolution.x] doesn't match %x
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.phpPuzzler! In ImageMagick 6.5.8-9 I get
identify -format "%x - %[resolution.x] - %[fx:resolution.x]" SeedImage_9.jpg