On Fri, 4 Nov 2011 10:27:35 -0700
Fred Weinhaus <f...@alink.net> 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 )    <a.thys...@griffith.edu.au>
 --------------------------------------------------------------------------
  The warrior didn't speak, for his mouth was full.  -- "Kung Fu Panda"
 --------------------------------------------------------------------------
   Anthony's Castle     http://www.ict.griffith.edu.au/anthony/
_______________________________________________
Magick-users mailing list
Magick-users@imagemagick.org
http://studio.imagemagick.org/mailman/listinfo/magick-users

Reply via email to