#!/bin/bash mkdir -p thumbs for file in */*.{jpg,JPG,jpeg,JPEG,gif,GIF,png,PNG} ; do if [ -f "$file" -a ! -f "thumbs/$(basename $file)" ]; then convert "$file" -thumbnail '72x72>' -background grey \ -gravity center -extent 72x72 "thumbs/$(basename $file)" fi done echo '' > thumbs.html for file in */*.{jpg,JPG,jpeg,JPEG,gif,GIF,png,PNG} ; do if [ -f "$file" -a "$(dirname "$file")" != "thumbs" ]; then echo '' >> thumbs.html echo "" >> thumbs.html echo '' >> thumbs.html fi done echo '' >> thumbs.html