set a variable with a image width to use in batch file

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
minipra

set a variable with a image width to use in batch file

Post by minipra »

Iam trying to set a variable with a width of a image.. iam new to image magick .. please help

set c=identify -ping -format bg.png
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: set a variable with a image width to use in batch file

Post by fmw42 »

minipra wrote:Iam trying to set a variable with a width of a image.. iam new to image magick .. please help

set c=identify -ping -format bg.png

If on unix:

width=`identify -ping -format "%w" bg.png`
echo $width

see
http://www.imagemagick.org/script/escape.php
minipra

Re: set a variable with a image width to use in batch file

Post by minipra »

Iam using windows

set width="identify -ping -format "%%w" bg.png"
echo %width%

when i try the above all i get is the entire string as the value of width ... "identify -ping -format "%%w" bg.png"
minipra

Re: set a variable with a image width to use in batch file

Post by minipra »

fmw42 wrote:
minipra wrote:Iam trying to set a variable with a width of a image.. iam new to image magick .. please help

set c=identify -ping -format bg.png

If on unix:

width=`identify -ping -format "%w" bg.png`
echo $width

see
http://www.imagemagick.org/script/escape.php
what will be the windows equivalent of the above.. thank you
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: set a variable with a image width to use in batch file

Post by fmw42 »

minipra wrote:
fmw42 wrote:
minipra wrote:Iam trying to set a variable with a width of a image.. iam new to image magick .. please help

set c=identify -ping -format bg.png

If on unix:

width=`identify -ping -format "%w" bg.png`
echo $width

see
http://www.imagemagick.org/script/escape.php
what will be the windows equivalent of the above.. thank you

Sorry I am not a Windows user. But see http://www.imagemagick.org/Usage/api/#windows
Post Reply