Re: extract info from identify output
Anthony Thyssen <[email protected]> Sat, 5 Nov 2011 15:26:27 +1000
| Newsgroups | gmane.comp.video.image-magick.user |
|---|---|
| Message-ID | <20111105152627.15dbb128@wraith> |
On Fri, 4 Nov 2011 10:27:35 -0700 Fred Weinhaus <[email protected]> wrote: | 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/ | Another way that can be used for BASH scripting is a multi-field read. For example... read width height filesize \ <<< $( convert -ping rose: -format "%w %h %b" info: ) echo $width $height $filesize 70 46 9673B This is very advanced but works very well! PS: it is a good idea that -ping is put before the image! Anthony Thyssen ( System Programmer ) <[email protected]> -------------------------------------------------------------------------- The warrior didn't speak, for his mouth was full. -- "Kung Fu Panda" -------------------------------------------------------------------------- Anthony's Castle http://www.ict.griffith.edu.au/anthony/