Sips: resize image's smallest side, not largest side The command sips -z 2000 image.jpg will resize the biggest side of an image to 2000 if it is greater than 2000, while preserving the original aspect ratio.
Is there a similar command that will resize the smallest side of an image to 2000 if it is greater than 2000, while preserving the original aspect ratio?
The rationale behind this request is that if I try to downsize the greatest side of an image to 2000, it will greatly affect the resolution of panoramas and other long/wide images.
Apparently using ImageMagick yields more favorable results when compared to sips, so using ImageMagick instead might be better. The command to do so is:
convert image.jpg -resize '2000x2000^&gt;' image-resized.jpg

The 2000x2000^ resizes the image so that its shortest side is at least 2000 pixels. So, for example:
6000x4000 → 3000x2000
4000x6000 → 2000x3000

The &gt; character prevents it from acting upon images that would be upscaled, and as a result:
600x400 → 600x400
8000x1500 → 8000x1500