set -e SIZE=150 # thumb image size ROW=5 # row length COUNT=30 # number of pix per page INDEX=A000.htm # save name of first image, link to HTML mkdir -p thumbs chmod 755 thumbs cat <| $INDEX Picture Gallery Index

Picture Gallery Index

EOF ############################################# function header() { ( HTML=$1 >| $HTML cat < Picture Gallery $page <br><br>

Click on a thumbnail to enlarge. EOF ) >> $HTML; } ############################################# ((page=101)) HTML=A${page}.htm header $HTML ((x=10000)) ((inRow=0)) # put the file names of all -.jpg files into /tmp/piclist du -a * | egrep -v 'Junk|thumbs|xvpics' | grep -i 'jpg$' | awk '{print $2}' | sort >| /tmp/piclist ((next=page+1)) echo " ((Next page))

" >> $HTML for i in `cat /tmp/piclist` do convert -geometry $SIZE $i thumbs/${x}.jpg chmod 644 $i thumbs/${x}.jpg ( cat < EOF ) >> $HTML ((tmp = x % COUNT)) ((x=x+1)) ((inRow=inRow+1)) if (( inRow% $ROW == 0 )) then echo ' ' >> $HTML ((inRow=0)) fi if (( x % COUNT == 0 )) then # end of a table. echo "
$i" >> $INDEX echo '

' >> $HTML ((next=page+1)) echo "
((Next page)) " >> $HTML ((prev=page)) ((page=page+1)) ((next=page+1)) HTML=A${page}.htm header $HTML echo " ((Previous page)) " >> $HTML echo " ((Next page)) " >> $HTML ((inRow=0)) fi done ############################################# echo '

' >> $HTML echo '' >> $INDEX ############################################# echo Largest file id: ${x}.