#!/bin/sh # # simple JPG thumbnail & index file generator # Written by David Santinoli # Dependencies: djpeg, cjpeg, pnmscale # # No command line parameters. Everything is hardwired, which is by far the best # programming style :-] # # Run this script in the directory containing the JPEGs. Both a `thumb' # directory and an `index.html' file (truncating any previous one) are created. # COLS=4 HEIGHT=80 mkdir -p thumb echo "" > index.html echo -e "\n" >> index.html count=0 # for i in *.jpg *.JPG ; do for i in `ls -rt *.jpg *.JPG` ; do if [ -f $i ] ; then echo Now scaling $i djpeg $i | pnmscale -ysize $HEIGHT | cjpeg > thumb/$i echo -e "" >> index.html count=$(($count+1)) if [ $count -eq $COLS ] ; then echo "" >> index.html count=0 fi fi done while [ $count -ne $COLS ] ; do echo "" >> index.html count=$(($count+1)) done echo -e "
\n
$i\n
 
\n

\n" >> index.html echo "index compiled with minio" >> index.html echo "" >> index.html