Create Thumbnails from a bunch of images
#!/bin/bash
# take argument or use current dir
DIR=${1:-`pwd`}
# create dir thumbs if doesnt exist
[ -d "$DIR/thumbs" ] || mkdir "$DIR/thumbs"
# error out if cant enter dir for some reason (permissions?)
cd "$DIR" || { echo >&2 "error: couldn't enter directory: $DIR"; exit 1;}
# For every file with extension XXX (jpg in this case)
for i in ./*.jpg; do
# Resize image to 100x100
convert "$i" -resize 100x100 "$DIR/thumbs/$i"
# profit? nah.
done