Page 1 of 1

Resizing based on height alone

Posted: 2015-05-13T15:21:50-07:00
by Drew.Yuschock
Hey guys,

I'm doing some work batch converting svgs to pngs and as part of this, I would like to set a hard cap on the height of converted image while the width could vary.

Is this possible from command line or would I not be able to do so.

Right now I'm doing

Code: Select all

for /r %%v in (*.svg) do convert "%%v" "%%~nv.png"
But I'd like to say "I want the new height of the image to 600 and maintain that ratio with the width"

So that if an image is 100x100 its new size would be 600x600 and if an image is 100x200 its converted size would be 600x1200.

Thanks!

Drew

Re: Resizing based on height alone

Posted: 2015-05-13T15:24:41-07:00
by fmw42
try

Code: Select all

convert image -resize x600 result
see
http://www.imagemagick.org/script/comma ... p#geometry


Also mogrify can do a whole directory without your having to build a script to loop over images.

see
http://www.imagemagick.org/Usage/basics/#mogrify

Re: Resizing based on height alone

Posted: 2015-05-13T15:26:14-07:00
by Drew.Yuschock
Thanks!

I spent a little time looking at the resizing options but there were so many there.