Skip to content

Instantly share code, notes, and snippets.

Created December 27, 2012 21:55
Show Gist options
  • Save anonymous/4392400 to your computer and use it in GitHub Desktop.
Save anonymous/4392400 to your computer and use it in GitHub Desktop.
Using ImageMagick to make thumbs of a folder of images... all this in a shell script for easy batching.
#!/bin/bash
# modify these two variables to be the width and height of your desired thumbnails
width=250
height=250
clear
echo Resizing your images and making thumbs
for img in `ls *.jpg`
do
name=${img%.*}
ext=${img#*.}
convert -sample ${width}x${height}^ -gravity center -crop ${width}x${height}+0+0 $img $name-thumb.$ext
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment