#!/bin/ksh chmod +w * chmod +r * chgrp botany * for file in *.jpg do output=`echo $file | sed -e 's/.jpg/.gifs/'` if [[ ! -a $output ]] then echo "doing $file, outputting to $output" # bring the potentially old jpeg file up to date: touch $file djpeg -P $file | pnmscale -xysize 120 120 | ppmquant 256 | ppmtogif -interlace > $output fi done for file in *.gif do output=`echo $file | sed -e 's/.gif/.gifs/'` if [[ ! -a $output ]] then echo "doing $file, outputting to $output" # bring the potentially old gif file up to date: touch $file giftoppm $file | pnmscale -xysize 120 120 | ppmquant 256 | ppmtogif -interlace > $output fi echo "interlacing $file" cp $file $file.bak giftoppm $file.bak | ppmtogif -interlace > $file done exit 1 #for descfile in DESC* for descfile in DESC.isao do cat $descfile | awk ' BEGIN { printed = 1; images = 0; for (element in image) { delete image[element] delete desc[element] } } /^[ ]*\#/ { # comment line next; } /^IMAGE:/ { sub("^IMAGE:[ ]*","",$0); sub("[ ]*$","",$0); image[++images] = $0; next; } /^PUB:/ { sub("^PUB:[ ]*","",$0); pub = $0; issue=""; date=""; page=""; next; } /^ISSUE:/ { sub("^ISSUE:[ ]*","",$0); issue = $0; next; } /^DATE:/ { sub("^DATE:[ ]*","",$0); date = $0 next; } /^PAGE:/ { sub("^PAGE:[ ]*","",$0); page = $0 next; } /^NAME:/ { sub("^NAME:[ ]*","",$0); printed = 0; name = $0 next; } /^DESC:/ { sub("^DESC:[ ]*","",$0); desc[images] = $0; next; } /^CREDIT:/ { sub("^CREDIT:[ ]*","",$0); credit = $0 next; } /^TEXT:/ { intext++; text = "true" next; } /^\}$/ { intext=0; next; } /^$/ { if (intext) { print "
" } else if (!printed) { file = image[1] sub(".gif",".html",file); sub(".jpg",".html",file); printed++; print "
" >> file while ((getline < "temp.process") == 1) { print $0 >> file } print "
" >> file system("rm -f temp.process") } if (credit != "" || pub != "" || issue != "" || date != "" || name != "" || page != "") { print "
" >> file } text="" images = 0; for (element in image) { delete image[element] delete desc[element] } close(file); } next; } // { if (intext) { text = "true" print >> "temp.process" } else { ; } next; } ' done rm -f "temp.process" #shar -bcv *.gifs *.html *.jpg > sharfile