Skip to content

Instantly share code, notes, and snippets.

@chuckn246
Created July 15, 2016 03:29
Show Gist options
  • Select an option

  • Save chuckn246/a3670df78839ed91ad5801622693bae8 to your computer and use it in GitHub Desktop.

Select an option

Save chuckn246/a3670df78839ed91ad5801622693bae8 to your computer and use it in GitHub Desktop.
Recursively resize and rename images with imagemagick convert.
for d in ./*/ ; do (cd "$d" && convert -define jpeg:size=WxH *.jpg -thumbnail 'WxH>' -background white -gravity center -extent WxH -set filename:newname "%t.%e" 'rose_%[filename:newname]'); done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment