Skip to content

Instantly share code, notes, and snippets.

@skounis
Created November 29, 2013 19:04
Show Gist options
  • Save skounis/7710439 to your computer and use it in GitHub Desktop.
Save skounis/7710439 to your computer and use it in GitHub Desktop.
batch resize. mac os. terminal
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