info.html
$title Photo Info
$title
Photo Info
EOF
for jfile in *.JPG; do
[ "X$jfile" = "X*.JPG" ] || mv $jfile `basename $jfile .JPG`.jpg
done
for jfile in *.jpg; do
fname=`echo "$jfile" | tr -d "'\ \""`
bname=`basename "$fname" .jpg`
sname="$bname-s.jpg"
# Let's ignore previously created thumbnails.
t1=`basename "$bname" "-m"`
t2=`basename "$bname" "-s"`
[ "$bname" = "$t1" ] || continue
[ "$bname" = "$t2" ] || continue
# Rename files so they're somewhat standard. (Back up file beforehand.)
[ "$jfile" = "$fname" ] || [ -f "$jfile~" ] || cp -p "$jfile" "$jfile~"
[ "$jfile" = "$fname" ] || mv -i "$jfile" "$fname"
echo "Processing $fname ($jfile)"
# Create thumbnail and medium-sized versions of the pics.
[ -f "$bname-m.jpg" ] || \
djpeg -scale $MSCALE "$fname" | cjpeg -quality 90 > $bname-m.jpg
[ -f "$sname" ] || \
djpeg -scale $SSCALE "$fname" | cjpeg -quality $THUMBQUALITY > $sname
# Try to grab a caption for the photo.
if [ -f $CAPTIONS ]; then
capt=`grep "^$bname " $CAPTIONS | tr "\"" "'" | cut -f2`
subhead=`grep "^$bname " $CAPTIONS | tr "\"" "'" | cut -f3`
fi
if [ "X$capt" != "X" ]; then
echo " $capt"
fi
# First time through, grab camera info.
if [ $n -eq 0 ]; then
case ${CAMERAHDR} in
[Yy][Ee][Ss])
echo "
" >> info.html
exiftags -cq $EXIFOPTS "$fname" | sed 's/: / /' | \
awk 'BEGIN { FS = " " } { printf "| %s: | %s |
", $1, $2 }' >> info.html
echo "
" >> info.html
;;
*)
EXIFOPTS="-c $EXIFOPTS"
echo "" >> info.html
;;
esac
fi
n=$(($n + 1))
# Write a subheading.
if [ "X$subhead" != "X" ]; then
cat <> index.html
$subhead |
EOF
n=1
fi
# Populate the index.
cat <> index.html
 [med] |
[big] | [info]
$capt |
EOF
# Populate the Exif info.
cat <> info.html
$fname |
|
EOF
exiftags -iq $EXIFOPTS "$fname" | sed 's/: / /' | \
awk 'BEGIN { FS = " " } { printf "| %s: | %s | \n", $1, $2 }' >> info.html
echo " |
" >> info.html
[ $(($n % $COLUMNS)) -eq 0 ] && echo "
" >> index.html
done
cat <> index.html
photoweb
EOF
wwwis index.html info.html
rm -f index.html~ info.html~