On 10/19/06, Hugemann <[EMAIL PROTECTED]> wrote:
 > height = `identify -format '%h' target.jpg`
 > width  = `identify -format '%w' target.jpg`

I assume that this works fine in a UNIX shell (or equivalent), but in a
Windows environment it is not that easy. The return value of identify is
 written to stdout and in a DOS shell there is no way of storing it in
a variable. Here is our code that works in a DOS shell:

Why are you running a  DOS shell on Windows? Use cmd.exe which allows
you to do that by putting single quotes around the list parameter to
for/f. For example, here's a roundabout way to get a directory list:

for /f "delims=" %f in ('dir /b') do @echo %f

You would want to do something like this:

for /f %h in ('identify -format '%h' target.jpg') do set height=%h
for /f %w in ('identify -format '%w' target.jpg') do set height=%w

GNS
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users

Reply via email to