Re: extract info from identify output
Fred Weinhaus <[email protected]> Fri, 4 Nov 2011 10:27:35 -0700
| Newsgroups | gmane.comp.video.image-magick.user |
|---|---|
| Message-ID | <p06240804cad9d0736d32@[192.168.1.2]> |
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.