Convert or don't convert (solved)

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
Albireo
Posts: 68
Joined: 2010-01-12T03:32:23-07:00
Authentication code: 8675309

Convert or don't convert (solved)

Post 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
Last edited by Albireo on 2010-02-08T07:43:15-07:00, edited 1 time in total.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Convert or don't convert

Post 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.
snibgo's IM pages: im.snibgo.com
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Convert or don't convert

Post 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.
snibgo's IM pages: im.snibgo.com
Albireo
Posts: 68
Joined: 2010-01-12T03:32:23-07:00
Authentication code: 8675309

Re: Convert or don't convert

Post 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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Convert or don't convert (solved)

Post 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
Post Reply