#!/bin/tcsh # # hepu2fet_key # # usage: # cd /dosd/pictures/d70/dcim # hepu2fet_key helsinki200503_isu_sel.list helsinki200503 /home/purnhage/data/www/fet/pictures/helsinki200503 2005 _isu # # http://www.heikopurnhagen.net/software/hepu2fet_key # # This program is available under the terms of the GNU General Public # License (GPL). All usual disclaimers apply! # # Heiko Purnhagen (mail@heikopurnhagen.net) # HP 20050315 20050605 20051128 20060624 20070518 20070908 20080811 # HP 20080817 replacing footer in index page # HP 20090930 process only if source file newer than destination file # HP 20110109 specified font and size for imprint set basenames=`awk '{print $1}' $1` if ( { test ! -e $3"/thumbs" } ) then echo "MAKING "$3"/thumbs" mkdir -p $3"/thumbs" else echo "EXISTING "$3"/thumbs" endif if ( { test $2"/index"$5".html" -nt $3"/index"$5".html" } ) then echo "GENERATING index"$5".html" hepu2fet_fixfoot year=$4 < $2"/index"$5".html" >! $3"/index"$5".html" else echo "UP-TO-DATE index"$5".html" endif foreach f ($basenames) if ( { test $2/$f$5"_.html" -nt $3/$f$5"_.html" } ) then echo "GENERATING "$f$5"_.html" grep -v "

.* Heiko Purnhagen $4

" $2/$f$5"_.html" | grep -v "

.* Heiko Purnhagen $4

" | sed "sQ (selected)QQg" >! $3/$f$5"_.html" else echo "UP-TO-DATE "$f$5"_.html" endif end foreach f ($basenames) echo "COPYING thumbs/"$f"_thumb.jpg" \cp -a $2"/thumbs/"$f"_thumb.jpg" $3/thumbs end foreach f ($basenames) if ( { test $2/$f -nt $3/$f } ) then echo "IMPRINTING "$f set textpos=`identify -format "%w %h" $2/$f | awk '{printf "%d,%d",$1-150,$2-6}'` convert -quality 93 -sampling-factor 1x1 -fill white -font helvetica -pointsize 12 -draw "text $textpos '(c) Heiko Purnhagen $4'" $2/$f $3/$f else echo "UP-TO-DATE "$f endif end if ( { test ! -e $3/.htaccess } ) then echo "GENERATING .htaccess" \echo "AddDefaultCharset Off" >! $3/.htaccess else echo "EXISTING .htaccess" endif echo "COPYING *32x16a.gif" \cp -a $2"/"*32x16a.gif $3 #--