Page 1 of 1

Convert or don't convert (solved)

Posted: 2010-02-08T04:45:12-07:00
by Albireo
Hi!

I want to convert a number of images to the same size.
for example: maximum 550 x 550 pixels
but
I don't want to do anything if the original image is smaller than 550 pixels

Is it possible with ImageMagick?
(or should I handle this in some other way?)

//Jan

Re: Convert or don't convert

Posted: 2010-02-08T05:27:20-07:00
by snibgo

Code: Select all

convert input.jpg -resize "500x500^" output.png
The ^ (caret) means "don't resize unless at least one dimension is greater than what I want".

I use Windows, and ^ is a special character, so I need the quotes.

Re: Convert or don't convert

Posted: 2010-02-08T05:50:38-07:00
by snibgo
For "caret" in the above, read "greater than" (>).

Code: Select all

convert input.jpg -resize "500x500>" output.png
That will teach me not to post in a hurry.

Re: Convert or don't convert

Posted: 2010-02-08T07:42:45-07:00
by Albireo
snibgo wrote:For "caret" in the above, read "greater than" (>).

Code: Select all

convert input.jpg -resize "500x500>" output.png
That will teach me not to post in a hurry.
Thank you!
Hmmm, I thought that the size always resize to the desired size

//Jan

Re: Convert or don't convert (solved)

Posted: 2010-02-08T11:17:18-07:00
by fmw42
Hmmm, I thought that the size always resize to the desired size
not unless you add exclamation !

see http://www.imagemagick.org/script/comma ... p#geometry