#!/bin/sh # a small hack to generate web pages out of a bunch of images # it uses the embedded description as defined in # http://www.w3.org/TR/photo-rdf/ # to generate captions and alt text for accessibility purposes # (c) 2000-2003 by Yves Lafon / W3C - ylafon@w3.org # Mon Jun 5 18:33:52 MET DST 2000 (first ugly hack) # change Thu Jan 4 00:29:53 MET 2001 added -png # change Thu Feb 8 11:09:23 MET 2001 added meta generator # change Tue Jul 3 16:02:24 MET DST 2001 fixed bug when x_size was < 100 # change Fri Jul 20 13:47:44 MET DST 2001 added date in meta # change Tue Nov 13 17:04:00 MET 2001 added individual HTML files and navigation # change Tue Nov 13 18:12:39 MET 2001 added dump of exif information if # available depends on epinfo from photopc # change Tue Jan 8 23:39:30 MET 2002 added medium size jpeg to avoid too big # images # change Thu Jan 10 22:40:54 MET 2002 don't work on -med.jpg pictures # change Tue Jan 15 15:21:53 MET 2002 Added section on individual pages # change Wed Jan 16 19:55:26 MET 2002 Added section to index pages # change Mon Jan 28 22:43:02 MET 2002 Size of images in individual files # change Tue May 7 03:46:50 MEST 2002 Changed to work with rdfpic 2.0 and 2.1 # change Fri May 17 17:00:24 MEST 2002 Removed options for midsize jpeg as IE # is unable to display optimized jpegs... # change Thu Jul 18 21:07:13 MEST 2002 Fixed HTML and added a link to the index # page, if set (-idurl and -link options) # change Sun Aug 18 16:38:39 MEST 2002 Added -css and -icss options # change Thu Aug 29 19:07:03 MEST 2002 Bug fix on next link calculation # improved speed, fixed thumbnail generation # change Tue Oct 15 00:07:06 MEST 2002 Bug fix on image extension capitalization # change Sun Jan 12 18:37:29 MET 2003 Added meta descrption in the picture page # change Mon Mar 29 11:35:13 CEST 2004 Bug fix in last page calculation and an # unwanted link in in with -nordf # change Tue Jun 29 23:42:42 CEST 2004 Added google friendly medium image name # (which is a pain as it adds semantic # in the URI while it is already there # in the file) # change Tue Aug 31 17:45:30 CEST 2004 Added support for XMP from Adobe # change Fri Apr 1 22:12:26 CEST 2005 Added support for big image size reduction # using 3 different predefined sizes # Added link to medium size pictures only # change Thu Apr 7 16:13:24 CEST 2005 Added -gsq to generate square thumbnails # change Mon Sep 5 15:03:03 CEST 2005 Added -midfilter to add image filters (pnm only!) # during the mid-size picture creation # change Tue Jul 21 17:30:54 CEST 2009 Added support for Lightroom generated metadata # change Mon May 30 14:29:16 CEST 2011 Recode utf-8 encoded metadata to html entities # # $Id: genepage,v 1.50 2014-06-23 11:32:07 ylafon Exp $ # imglimit=16 rowlimit=4 imgnb=0 serietitle="@@CHANGEME@@" dirn=.small dothumbs=0 dosq=0 domeds=0 usecssurl=0 cssurl="" iusecssurl=0 usegooglemedname=0 icssurl="" copyr="© 2014 by Yves Lafon" indexname=index use_png=1 jpeg_only=0 t_ext="png" note="" use_exif=0 use_med=1 gversion="1.49" medsize=307200 # size for 640x480 rdfmime=text%2Frdf idurl=/people/yves/pictures.html linktoindex=0 linkrdf=0 usexmp=0 lightroom=0 medonly=0 reduce=0 midfilter=cat # a sample function to compute the name of the index file printPageNum() { if [ $1 -gt 99 ]; then echo ${indexname}$1.html elif [ $1 -gt 9 ]; then echo ${indexname}0$1.html elif [ $1 = 0 ]; then echo ${indexname}.html else echo ${indexname}00$1.html fi } # some options if [ $# -gt 0 ]; then for arg do case "$1" in "-640" ) shift; medsize=307200;; "-800" ) shift; medsize=480000;; "-1024" ) shift; medsize=786432;; "-nomed" ) shift; use_med=0;; "-d" ) shift; dirn=$1; shift;; "-t" ) shift; serietitle=$1; shift;; "-r" ) shift; rowlimit=$1; shift;; "-p" ) shift; imglimit=$1; shift;; "-gif" ) shift; use_png=0; t_ext="gif";; "-png" ) shift; use_png=1; t_ext="png";; "-g" ) shift; dothumbs=1;; "-gsq" ) shift; dothumbs=1; dosq=1;; "-link" ) shift; linktoindex=1;; "-gmed" ) shift; domeds=1;; "-medonly") shift; medonly=1;; "-c" ) shift; copyr=$1; shift;; "-i" ) shift; indexname=$1; shift;; "-idurl" ) shift; idurl=$1; shift;; "-j" ) shift; jpeg_only=1;; "-n" ) shift; note=$1; shift;; "-exif" ) shift; use_exif=1;; "-nordf" ) shift; linkrdf=0;; "-rdf" ) shift; linkrdf=1;; "-css" ) shift; cssurl=$1; usecssurl=1; shift;; "-icss" ) shift; icssurl=$1; iusecssurl=1; shift;; "-google" ) shift; usegooglemedname=1;; "-xmp" ) shift; usexmp=1;; "-lightroom") shift; usexmp=1;lightroom=1;; "-max1024") shift; reduce=1024; maxpixels=786432;; "-max1280") shift; reduce=1280; maxpixels=1310720;; "-max1600") shift; reduce=1600; maxpixels=1920000;; "-midfilter") shift; midfilter=$1; shift;; "-h" ) echo "Usage: `basename $0` [-g -png -d -t -r <max img per row> -p <max img per page> -c <copyright> -i <indexname> -j]" echo " -640 : medium size will fit in 640x480 pixels" echo " -800 : medium size will fit in 800x600 pixels" echo " -1024 : medium size will fit in 1024x768 pixels" echo " -nomed : do not use medium size jpegs" echo " -g : generate thumbnails" echo " -gsq : generate square thumbnails" echo " -gmed : generate medium size jpegs" echo " -medonly : link only to the medium size jpeg, not the big one" echo " -png : thumbnails are in png (work also with -g) (this is the default)" echo " -gif : thumbnails are in gif (work also with -g)" echo " -d <thumbdirname> : change the directory name for thumbnails (default .small)" echo " -t <title> : title of this serie of picture" echo " -r <max_img_row> : maximum number of thumbnails per row" echo " -p <max_img_page> : maximum number of thumbnails per page" echo " -c <copyright> : copyright string" echo " -i <indexname> : name of the index file, default to index index001 index002..." echo " -idurl <url> : the URL of the index page, containing all your photo index pages" echo " -j : thumbnail link directly to the jpeg file, not the individual HTML files" echo " -n <note> : extra raw HTML put below the title" echo " -exif : dump also EXIF information if present (not used if -j)" echo " -link : place a link at the beginning to the index page (see -idurl)" echo " -nordf : don't link to the RDF but to the picture/html page" echo " -rdf : link to the RDF rather than to the picture/html page" echo " -css : use the CSS present at this URL instead of the default one" echo " -icss : use the CSS present at this URL instead of the default one for individual pages" echo " -google : use google-friendly way to generate mid-size images and names" echo " -xmp : use XMP instead of RDFPic format" echo " -midfilter : uses a filter to generate the mid size picture" echo " -lightroom : use XMP flavour from lightroom" exit 1 ;; * ) if [ "$1" != "" ]; then may_use_this=`echo $may_use_this $1` shift fi;; esac done fi # ensure that we will work on valid jpeg files echo "Checking file list..." if [ "$may_use_this" != "" ]; then for i in $may_use_this ; do echo $i | grep .-med.jpg > /dev/null if [ $? -eq 1 ]; then # Here we rely on file, not alway perfect on some system # it might be slower(?) but safer tu use rdjpgcom > /dev/null and have $? -eq 0 # file $i | grep "JPEG" > /dev/null rdjpgcom $i > /dev/null 2> /dev/null if [ $? -eq 0 ]; then use_this=`echo $use_this $i` fi fi done else may_use_this=`ls *.[Jj][Pp][Gg] | grep -v .-med.jpg` for i in $may_use_this ; do file $i | grep "JPEG image" > /dev/null if [ $? -eq 0 ]; then use_this=`echo $use_this $i` fi done fi echo "Done..." # count how many pictures firstimage="" for i in $use_this ; do if [ "$firstimage" = "" ]; then firstimage=$i fi # case "$file_type" in # "JPEG" | " imgnb=`expr $imgnb + 1` if [ "$i" != "" ]; then lastimage=$i fi # esac done basen=`echo $firstimage | sed -e 's/\(.*\)\..*/\1/'` firsthtmlname=${indexname}-`echo $basen | sed 's|.*/||'`.html basen=`echo $lastimage | sed -e 's/\(.*\)\..*/\1/'` lasthtmlname=${indexname}-`echo $basen | sed 's|.*/||'`.html firstindex=${indexname}.html nbpage=`expr $imgnb / $imglimit` if [ `expr $imgnb % $imglimit` -eq 0 ]; then nbpage=`expr $nbpage - 1` fi lastindex=`printPageNum $nbpage` pagenum=0 imgnum=0 prevfile="" echo "Found $imgnb images" # generate the first header pagename=`printPageNum $pagenum` cat > $pagename <<EOF <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> <html> <head> <meta name="generator" content="genepage v${gversion}, thumbnail page generator. yves@raubacapeu.net"> EOF echo "<meta name=\"date\" content=\""`date`"\">" >> $pagename echo "<link rel=\"top\" href=\"$idurl\">" >> $pagename echo "<link rel=\"index\" href=\"$idurl\">" >> $pagename echo "<link rel=\"first\" href=\"$firstindex\">" >> $pagename echo "<link rel=\"last\" href=\"$lastindex\">" >> $pagename if [ $nbpage -gt 0 ]; then echo "<link rel=\"next\" href=\"`printPageNum 1`\">" >> $pagename fi echo "<title>$serietitle" >> $pagename if [ $usecssurl -eq 0 ]; then cat >> $pagename < body { background-color: white; font-family: Helvetica; } td { font-family: Helvetica; } .imgname { font-family: Helvetica; font-size: small; text-align: center; color: white; width: 100px; } p a { color: white } .dirname { color: yellow; font-weight: bold; font-size: large; font-family: helvetica, sans-serif; font-style:italic; } .footnote { font-family: Helvetica; font-size: small; } .lindex { color: black; } @media print { .navbar { display: none; } } EOF else echo "" >> $pagename fi cat >> $pagename <
EOF if [ $linktoindex -eq 1 ]; then echo "

$serietitle

" >> $pagename else echo "

$serietitle

" >> $pagename fi cat >> $pagename < EOF rowi=0 imgi=0 # dump the images next_list=$use_this for i in $use_this ; do if [ $dothumbs -eq 1 ]; then echo $i | grep / > /dev/null if [ $? -eq 1 ]; then icondir=$dirn else basedir=`echo $i | sed 's|\(.*/\).*|\1|'` icondir=`echo ${basedir}${dirn}` fi if [ ! -d "$icondir" ]; then mkdir "$icondir" fi echo "Generating thumbnail in $icondir for $i" if [ $dosq -eq 0 ]; then th_param="-x" else th_param="-x -sq" fi if [ $use_png -eq 0 ]; then anytothumb $th_param $i > $icondir/`echo $i | sed -e 's|.*/||' -e s'/\.[Jj][Pp][Gg]$/\.gif/'` else anytothumb $th_param -png $i > $icondir/`echo $i | sed -e 's|.*/||' -e s'/\.[Jj][Pp][Gg]$/\.png/'` fi fi # file_type=`file "$i" | awk '{print $2}'` next_list=`echo $next_list | sed -e 's/^[^ ]*//' -e 's/^ *//'` file_type=JPEG y_size=0 case "$file_type" in "JPEG" ) if [ `expr $imgi % $rowlimit` -eq 0 ]; then echo "" >> $pagename fi echo adding $i to $pagename basen=`echo $i | sed -e 's/\(.*\)\..*/\1/'` thumb=${basen}.$t_ext midpic=${basen}-med.jpg if [ $usegooglemedname -eq 1 ]; then # check for rdf data in it ititle="" if [ $usexmp -eq 0 ]; then rdjpgcom $i 2> /dev/null | grep PhotoRDF > /dev/null if [ $? -eq 0 ]; then rdjpgcom $i 2> /dev/null | grep :Title > /dev/null if [ $? -eq 0 ]; then ititle=`rdjpgcom $i | grep :Title\> | sed 's/.*:Title>\(.*\)<.*:Title>.*/\1/'` else ititle=`rdjpgcom $i | grep :title\> | sed 's/.*:title>\(.*\)<.*:title>.*/\1/'` fi fi else rdjpgxmp $i 2> /dev/null > /dev/null if [ $? -eq 0 ]; then if [ $lightroom -eq 0 ]; then ititle=`rdjpgxmp $i | grep :title\> | sed 's/.*:title[^>]*>\(.*\)<.*:title>.*/\1/'` else t_loc=`rdjpgxmp $i | grep Iptc4xmpCore:Location | gsed 's/.*Iptc4xmpCore\:Location=\"\([^\"]*\)\".*/\1/'` t_city=`rdjpgxmp $i | grep photoshop:City | gsed 's/.*photoshop\:City=\"\([^\"]*\)\".*/\1/'` t_stat=`rdjpgxmp $i | grep photoshop:State | gsed 's/.*photoshop\:State=\"\([^\"]*\)\".*/\1/'` t_cnty=`rdjpgxmp $i | grep photoshop:Country | gsed 's/.*photoshop\:Country=\"\([^\"]*\)\".*/\1/'` echo t_loc="$t_loc" if [ "$t_loc" != "" ]; then ititle=`echo "$t_loc, $t_city, $t_state, $t_cnty"` else ititle=`echo "$t_city, $t_state, $t_cnty"` fi fi fi fi if [ "$ititle" != "" ]; then midpic=${basen}-`echo $ititle | recode h..bs | tr '[A-Z \"(),]' '[a-z_____]' | sed "s/'/_/g"`-med.jpg fi echo "Creating medium size picture: $midpic" fi htmlname=${indexname}-`echo $basen | sed 's|.*/||'`.html title=`expr $imgi + 1` descr="no description available" has_comm=0 # if needed, generate the medium file if [ $domeds -eq 1 ]; then # gift for IE... no progressive nor optimized jpegs djpeg -dct float $i | pnmscale -pixels $medsize | $midfilter | cjpeg -quality 85 -dct float > $midpic fi if [ $reduce -gt 0 ]; then echo "Reducing size of the big image $i" djpeg -dct float $i | pnmscale -pixels $maxpixels | cjpeg -quality 85 -dct float > tmp-${i} fi # jpg metadata extraction if [ $usexmp -eq 0 ]; then rdjpgcom $i 2> /dev/null | grep PhotoRDF > /dev/null # cool it has rdf embedded comment as defined in http://www.w3.org/TR/photo-rdf/ if [ $? -eq 0 ]; then rdjpgcom $i 2> /dev/null | grep :Title > /dev/null if [ $? -eq 0 ]; then title=`rdjpgcom $i | grep :Title\> | sed 's/.*:Title>\(.*\)<.*:Title>.*/\1/'` descr=`rdjpgcom $i | grep :Description\> | grep -v "" | sed 's/.*:Description>\(.*\)<.*:Description>.*/\1/' | sed 's/\"/\&\#34;/g'` else title=`rdjpgcom $i | grep :title\> | sed 's/.*:title>\(.*\)<.*:title>.*/\1/'` descr=`rdjpgcom $i | grep :description\> | grep -v "" | sed 's/.*:description>\(.*\)<.*:description>.*/\1/' | sed 's/\"/\&\#34;/g'` fi has_comm=1 if [ $domeds -eq 1 ]; then mv $midpic ${midpic}.tmp rdjpgcom $i | wrjpgcom -replace ${midpic}.tmp > $midpic rm ${midpic}.tmp fi if [ $reduce -eq 1 ]; then rdjpgcom $i | wrjpgcom -replace tmp-${i} > $i rm tmp-${i} fi fi else rdjpgxmp $i 2> /dev/null > /dev/null if [ $? -eq 0 ]; then if [ $lightroom -eq 0 ]; then title=`rdjpgxmp $i | grep :title\> | sed 's/.*:title>\(.*\)<.*:title>.*/\1/'` descr=`rdjpgxmp $i | grep :description\> | sed 's/.*:description>\(.*\)<.*:description>.*/\1/' | sed 's/\"/\&\#34;/g'` else t_desc=`rdjpgxmp $i | xmllint --format --encode utf-8 - | gsed -n '/dc:description/ { n;n; s, *]*>\([^<]*\).*,\1, ; p; N; N; d; } '` t_title=`rdjpgxmp $i | xmllint --format --encode utf-8 - | gsed -n '/dc:title/ { n;n; s, *]*>\([^<]*\).*,\1, ; p; N; N; d; } '` t_loc=`rdjpgxmp $i | grep Iptc4xmpCore:Location | gsed 's/.*Iptc4xmpCore\:Location=\"\([^\"]*\)\".*/\1/'` t_city=`rdjpgxmp $i | grep photoshop:City | gsed 's/.*photoshop:City=\"\([^\"]*\)\".*/\1/'` t_stat=`rdjpgxmp $i | grep photoshop:State | gsed 's/.*photoshop\:State=\"\([^\"]*\)\".*/\1/'` t_cnty=`rdjpgxmp $i | grep photoshop:Country | gsed 's/.*photoshop\:Country=\"\([^\"]*\)\".*/\1/'` if [ "$t_title" != "" ]; then title=`echo "$t_title" | recode u8..h` else if [ "$t_loc" != "" ]; then title=`echo "$t_loc" | recode u8..h` else title=`echo "$t_city" | recode u8..h` fi fi if [ "$t_loc" != "" ]; then location=`echo "$t_loc, $t_city, $t_stat, $t_cnty" | recode u8..h` else location=`echo "$t_city, $t_stat, $t_cnty" | recode u8..h` fi if [ "$t_desc" != "" ]; then descr=`echo "$t_desc" | recode u8..h` else descr=$location # should keep descr empty and fill location when needed fi fi has_comm=1 if [ $domeds -eq 1 ]; then mv $midpic ${midpic}.tmp echo "http://ns.adobe.com/xap/1.0/" > ${midpic}.xmp rdjpgxmp $i >> ${midpic}.xmp wrjpgapp -app1 -replace -cfile ${midpic}.xmp ${midpic}.tmp > $midpic rm ${midpic}.tmp ${midpic}.xmp fi if [ $reduce -gt 0 ]; then echo "http://ns.adobe.com/xap/1.0/" > tmp-${i}.xmp rdjpgxmp $i >> tmp-${i}.xmp wrjpgapp -app1 -replace -cfile ${i}.xmp tmp-${i} > $i rm tmp-${i} tmp-${i}.xmp fi fi fi # if we are reducing, just in case no metadata were found if [ $reduce -gt 0 ]; then if [ -f tmp-${i} ]; then mv tmp-${i} $i fi fi y_size=0 echo $thumb | grep "/" > /dev/null if [ $? -eq 0 ]; then basen=`echo $thumb | sed 's/\(.*\/\).*/\1/'` fname=`echo $thumb | sed 's/.*\///'` thb_file=${basen}$dirn/$fname else thb_file=$dirn/$thumb fi if [ $use_png -eq 0 ]; then x_size=`giftopnm $thb_file | pnmfile | awk '{print $4}'` y_size=`giftopnm $thb_file | pnmfile | awk '{print $6}'` else x_size=`pngtopnm $thb_file | pnmfile | awk '{print $4}'` y_size=`pngtopnm $thb_file | pnmfile | awk '{print $6}'` fi if [ $jpeg_only -eq 0 ]; then # link to the html file if [ $y_size -eq 0 ]; then echo "" >> $pagename else echo "

$title
" >> $pagename fi else if [ $jpeg_only -eq 0 ]; then echo "

$title
" >> $pagename else echo "

$title
" >> $pagename fi fi imgi=`expr $imgi + 1` # now create the HTML page associated with the page cat > ${htmlname} < EOF if [ "$descr" != "no description available" ]; then echo " " >> ${htmlname} fi if [ $linkrdf -eq 1 ]; then echo " " >> ${htmlname} fi echo " " >> ${htmlname} echo " " >> ${htmlname} echo " " >> ${htmlname} if [ $imgi -eq 1 ]; then if [ $imgi -lt $imgnb ]; then nextimg=$indexname-`echo $next_list | sed -e 's/\([^ ]*\).*/\1/' -e 's/\(.*\)\..*/\1/' -e 's|.*/||'` echo " " >> ${htmlname} fi else echo " " >> ${htmlname} nextimg=$indexname-`echo $next_list | sed -e 's/\([^ ]*\).*/\1/' -e 's/\(.*\)\..*/\1/' -e 's|.*/||'` if [ "$nextimg" != "$indexname-" ]; then echo " " >> $htmlname fi fi echo " " >> $htmlname echo " $title" >> $htmlname if [ $iusecssurl -eq 0 ]; then cat >> $htmlname < body { background-color: white; font-family: Helvetica; } .footnote { font-family: Helvetica; font-size: small; } @media print { .navbar { display: none; } } .caption { text-align: center; } .lindex { color: black; } EOF else echo " " >> $htmlname fi cat >> $htmlname <

$serietitle / $title

EOF navbox="" # now add the next/prev according to our position in the list if [ $imgi -eq 1 ]; then if [ $imgi -lt $imgnb ]; then nextimg=$indexname-`echo $next_list | sed -e 's/\([^ ]*\).*/\1/' -e 's/\(.*\)\..*/\1/' -e 's|.*/||'` navbox=`echo "

     | up | next

"` fi else if [ $imgi -lt $imgnb ]; then nextimg=$indexname-`echo $next_list | sed -e 's/\([^ ]*\).*/\1/' -e 's/\(.*\)\..*/\1/' -e 's|.*/||'` navbox=`echo "

prev | up | next

"` else navbox=`echo "

prev | up |     

"` fi fi echo $navbox >> ${htmlname} # now the image if [ $use_med -eq 1 ]; then x_size=`djpeg -fast -pnm $midpic | pnmfile | awk '{print $4}'` y_size=`djpeg -fast -pnm $midpic | pnmfile | awk '{print $6}'` if [ $medonly -eq 1 ]; then echo "

\"$descr\"

" >> ${htmlname} else echo "

\"$descr\"

" >> ${htmlname} fi else x_size=`djpeg -fast -pnm $i | pnmfile | awk '{print $4}'` y_size=`djpeg -fast -pnm $i | pnmfile | awk '{print $6}'` echo "

\"$descr\"

" >> ${htmlname} fi echo "

$descr

" >> ${htmlname} # another navigation box at the end echo $navbox >> ${htmlname} # if asked, try to dump exif data if [ $use_exif -eq 1 ]; then epinfo $i > /dev/null 2> /dev/null if [ $? -eq 0 ]; then # we have something! cat >> $htmlname <
\"$descr\"" >> $pagename else echo "\"$descr\"" >> $pagename fi else # or directly to the jpeg file if [ $y_size -eq 0 ]; then echo "\"$descr\"" >> $pagename else echo "\"$descr\"" >> $pagename fi fi if [ $linkrdf -eq 1 ]; then if [ $has_comm -eq 1 ]; then echo "

$title

EOF # read the output of epinfo lne by line epinfo $i | while read epinfolineraw ; do epinfoline=`echo $epinfolineraw | sed -e 's|<|\<|g' -e 's|>|\>|g'` echo "$epinfoline" | grep "=" > /dev/null if [ $? -eq 0 ]; then echo " " >> $htmlname else echo " " >> $htmlname fi done echo "
"`echo $epinfoline | sed 's|=.*||'`""`echo $epinfoline | sed 's|.*=||'`"
$epinfoline
" >> $htmlname # as we are rich, let's add a third menu bar at the end echo $navbox >> $htmlname fi fi cat >> ${htmlname} < $copyr EOF prevfile=${htmlname} # HTML page generation finished, go back to iundex page now # are we at the end of the page? if [ `expr $imgi % $imglimit` -eq 0 ]; then if [ $imgi -lt $imgnb ]; then echo "" >> $pagename if [ $pagenum -eq 0 ]; then nextp=`printPageNum 1` echo "
" >> $pagename else nxtp=`expr $pagenum + 1` prvp=`expr $pagenum - 1` echo "
" >> $pagename fi echo "" >> $pagename echo "$copyr" >> $pagename echo "" >> $pagename echo "" >> $pagename prevpage=$pagename pagenum=`expr $imgi / $imglimit` pagename=`printPageNum $pagenum` cat > $pagename < EOF echo " " >> $pagename echo " " >> $pagename echo " " >> $pagename echo " " >> $pagename echo " " >> $pagename echo " " >> $pagename if [ $pagenum -lt $nbpage ]; then nxtp=`expr $pagenum + 1` echo " " >> $pagename fi echo " $serietitle" >> $pagename if [ $usecssurl -eq 0 ]; then cat >> $pagename < body { background-color: white; font-family: Helvetica; } td { font-family: Helvetica; } .imgname { font-family: Helvetica; font-size: small; text-align: center; color: white; width: 100px; } p a { color: white } .dirname { color: yellow; font-weight: bold; font-size: large; font-family: helvetica, sans-serif; font-style:italic; } .footnote { font-family: Helvetica; font-size: small; } .lindex { color: black; } @media print { .nav { display: none; } } EOF else echo "" >> $pagename fi cat >> $pagename <
EOF if [ $linktoindex -eq 1 ]; then echo "

$serietitle

" >> $pagename else echo "

$serietitle

" >> $pagename fi cat >> $pagename < EOF fi fi ;; esac done echo "ALL DONE finishing page" #finish the footer of the last page and exit happily echo "
" >> $pagename if [ $pagenum -eq 0 ]; then echo "
" >> $pagename else prvp=`expr $pagenum - 1` echo "
" >> $pagename fi echo "" >> $pagename echo "$copyr" >> $pagename echo "" >> $pagename echo "" >> $pagename