Sips: resize image's smallest side, not largest side

Solution 1:

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^>' 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 > character prevents it from acting upon images that would be upscaled, and as a result:

600x400 → 600x400
8000x1500 → 8000x1500