Much easier to use string formats:

width=`convert image -ping -format "%w" info:`
height=`convert image -ping -format "%h" info:`
filesize=`convert image -ping -format "%b" info:`

See
http://www.imagemagick.org/script/escape.php

The above is unix command to put the results into variables. For 
windows, see http://www.imagemagick.org/Usage/windows/

Fred




>Hi,
>
>I'm using identify to get width, height and size of a jpeg, I assume that
>the size is always in the offset 6, but seems not the case, following are
>two jpeg files, the sample2.jpg has an additional field '256c', what is a
>reliable way to extract size of file from the output of identify?
>
>sample1.jpg JPEG 320x400 320x400+0+0 8-bit DirectClass 60.2KB 0.000u
>0:00.000
>sample2.jpg JPEG 375x600 375x600+0+0 8-bit PseudoClass 256c 79KB 0.000u
>0:00.000
>
>Angelo
>--
>View this message in context: 
>http://old.nabble.com/extract-info-from-identify-output-tp32778603p32778603.html
>Sent from the Magick-users mailing list archive at Nabble.com.
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users

Reply via email to