The script is a personal one, not appropriate for public consumption.
However once I get $rot (and extract comments from images) I use...
Code: Select all
echo >&2 "Generating Smaller Image..."
convert "$f" $rot -thumbnail ${nsize}x${nsize} -quality $nqual "$n"
where $f is the origina and $n is the new 'web' image
$nsize is set to 790 pixels.
The thumbnail image is basically as per the IM thumbnail examples...
Code: Select all
angle=`perl -e 'srand(); print rand() * 20 - 10'`
size=`convert "$n" -thumbnail ${tsize}x${tsize} \
-bordercolor white -border 6 \
-bordercolor grey60 -border 1 \
-background none -rotate $angle \
-background black \( +clone -shadow 60x4+4+4 \) +swap \
-background none -flatten \
-depth 8 -colors 256 -quality 95 \
-write "$t" -format "WIDTH=%w HEIGHT=%h" info:-`
thumbnail size is 100 pixels, and outputs a PNG image
If I want a simpler plain thumbnail (non-fancy) a GIF is used.
The images are only re-built if the source is newer, or a FORCE option is used.
The script then writes up the index.html with image comments, date, and generated thumbanil and so on.