Skip to content

Instantly share code, notes, and snippets.

@CapnKernel
Created October 6, 2012 03:22
Show Gist options
  • Save CapnKernel/3843650 to your computer and use it in GitHub Desktop.
Save CapnKernel/3843650 to your computer and use it in GitHub Desktop.
find . \( -iname \*.JPG -o -iname \*.JPEG \) -print | while read; do
# read puts the line it just read into REPLY
OUTPUT="$(echo $REPLY | sed -r -e 's@(.*)\.(jpg|jpeg|JPG|JPEG)$@\1-resize.\2@g')"
echo convert -resize 60% -quality 80 "$REPLY" "$OUTPUT"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment