#!/bin/sh
#
# $Id: iGenIndex,v 1.1 2001/11/20 03:11:28 vijoy Exp vijoy $
#
# Cleanup and create input
rm -rf Thumbs index.html; mkdir Thumbs
inputfile=`ls *++*`
txtfile=`cat txtfile`
# Extract the equipment and category information
if [ "X$txtfile" != "X" ]; then
category=`echo $txtfile|cut -d '#' -f 1`
txtfile=`echo $txtfile|cut -d '#' -f 2-`
equipment=`echo $txtfile|cut -d '#' -f 1`
txtfile=`echo $txtfile|cut -d '#' -f 2-`
else
category="Miscellaneous"
equipment="Olympus D-460 Zoom 1.3 MegaPixel Digital Camera"
fi
# For my own selfish needs
equipment="Olympus D-460 Zoom 1.3 MegaPixel Digital Camera"
cat="\nCategory:"`echo $category`"\n"
equip="Equipment:"`echo $equipment`
# Creating the basic HTML template
echo "Creating index..."
echo "" > index.html
echo "
" >> index.html
echo "Contents of this Photo Directory
" >> index.html
echo "Images from the "$category" category
" >> index.html
echo $equip"" >> index.html
echo "
" >> index.html
echo "" >> index.html
# Start the process
echo "Starting conversions..";
counter=0
captionfile=`echo $txtfile`
captionlist=`echo $inputfile`
for img in $inputfile
do
if [ ! -f $img ]; then
break
fi
# Annotate the thumbnails
if [ "X$txtfile" != "X" ]; then
# Description or caption information
descript="\nDesc:"`echo $txtfile|cut -d '#' -f 1`"\n"
txtfile=`echo $txtfile|cut -d '#' -f 2-`
# Keywords not present in description
wrd="Words:"`echo $txtfile|cut -d '#' -f 1`
txtfile=`echo $txtfile|cut -d '#' -f 2-`
fi
# Shove in the date and time info too
if [ "X$1" != "X" ];then
cinfo=`echo $1| sed s/\_/\ /g`
cinfo="\nCopyright "$cinfo"\n"
else
cinfo="\nCopyright Vijoy and Rachna Pandey\n"
fi
dinfo="Date:"`echo $img|cut -d '+' -f 1`" Time:"`echo $img|cut -d '+' -f 3`
# Create the thumbnails
convert -geometry 160x160 -bordercolor black -border 3x3 -comment \
"$cat$equip$descript$wrd$cinfo$dinfo" $img Thumbs/$img
counter=`expr $counter + 1`
if [ $counter -gt 4 ]; then
echo "
" >> index.html
counter=1
fi
name=`echo $img | cut -d '.' -f 1`
echo "" >> index.html
echo "" >> index.html
echo "" >> index.html
echo " " >> index.html
echo "["$name"] " >> index.html
echo " | " >> index.html
done
echo "
" >> index.html
if [ "X$captionfile" != "X" ]; then
echo "
" >> index.html
echo "Captioning Information
" >> index.html
for img in $captionlist
do
if [ ! -f $img ]; then
break
fi
descript=`echo $captionfile|cut -d '#' -f 1`
captionfile=`echo $captionfile|cut -d '#' -f 2-`
wrd=`echo $captionfile|cut -d '#' -f 1`
captionfile=`echo $captionfile|cut -d '#' -f 2-`
echo "- "$img": "$descript"
" >> index.html
done
fi
echo "
" >> index.html
echo "© 2000-2001 Vijoy and Rachna Pandey
" >> index.html
echo "" >> index.html