Problem with resizing doing the opposite of what is asked.

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
evanfort
Posts: 1
Joined: 2016-04-29T15:34:27-07:00
Authentication code: 1151

Problem with resizing doing the opposite of what is asked.

Post by evanfort »

Couldn't find this issue in a search, but I have a weird issue.

I just used convert to shrink a few thousand images and it worked on most of them. On a few though, it actually make the images smaller even though they were already smaller than the requested size.

Here is an example, original:
http://media3.picsearch.com/is?_Sj46cn8 ... height=232

After conversion:
https://s3.amazonaws.com/porcloud-stage ... 204880.jpg

Here is the command I used:
convert -quality 90 -resize 800x800\> 204880.jpg tn_204880.jpg

This image should have been left alone and output at the same size. Note, if I run it without the \> it will force the image to 800px wide, but some some reason, using this command it gets smaller instead. Any ideas?
Version: 6.7.7-10 2014-03-06 Q16
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Problem with resizing doing the opposite of what is asked.

Post by snibgo »

It works fine on a more recent version of IM, v6.9.2-5.

(I tried in the correct order: read input, then resize, then write output, as well as the incorrect order in your post.)
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Problem with resizing doing the opposite of what is asked.

Post by fmw42 »

What platform? Please always provide your IM version and platform. I presume it is Unix, since you use \>. IM 6.7.7.10 is ancient (about 160 versions old). You should try upgrading, if you can.

You can try also doing it with quotes.

Code: Select all

convert 204880.jpg -resize "800x800>" -quality 90 tn_204880.jpg
Unless you add !, it will resize preserving aspect ratio. So the larger dimension will go to 800 and the smaller dimension will scale smaller than 800 in proportion. But if you add !, it will distort the image to force it to 800x800.
Post Reply