Created
November 29, 2013 19:04
-
-
Save skounis/7710439 to your computer and use it in GitHub Desktop.
batch resize. mac os. terminal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for file in ./*.jpg | |
do | |
echo $file | |
width=`sips --getProperty pixelWidth "$file" | sed -E "s/.*pixelWidth: ([0-9]+)/\1/g" | tail -1` | |
if [[ $width -gt 1024 ]]; then | |
echo "$file - width $width" | |
sips --resampleWidth 1024 "$file" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment