I have some code that I've been using to resize images in Mac OS X via the command prompt (and/or quicksilver), to a maximum width or height of 500px. The only problem is that if the original image is smaller than 500px width or height, sips will upscale it. I would want it to just skip these images.
How can I make that happen?
This is my code:
#!/bin/bash
for ARG in "$@"
do
sips -Z 500 -s format jpeg "$ARG" --out "${ARG%.*}.jpg"
done