Skip to content

Instantly share code, notes, and snippets.

@atree
Created December 14, 2012 09:25
Show Gist options
  • Save atree/4284006 to your computer and use it in GitHub Desktop.
Save atree/4284006 to your computer and use it in GitHub Desktop.
Image resizing script
#!/bin/bash
# remove spaces from filename
IFS=$'\n';for f in `find .`; do file=$(echo $f | tr [:blank:] '_'); [ -e $f ] && [ ! -e $file ] && mv "$f" $file;done;unset IFS
# resize jpg
for i in *.{jpg,JPG}; do echo $i; convert $i -resize 800x600 $i; mogrify -quality 80% $i; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment