--- scripts/pgallery/src/pgallery.sh 2012/08/28 17:08:34 1.7 +++ scripts/pgallery/src/pgallery.sh 2012/08/29 11:21:41 1.11 @@ -5,7 +5,7 @@ # can do whatever you want with this stuff. If we meet some day, and you think # this stuff is worth it, you can buy me a beer in return Aron Schlesinger # -# $Paefchen: scripts/pgallery/src/pgallery.sh,v 1.6 2012/08/28 12:30:30 as Exp $ +# $Paefchen: scripts/pgallery/src/pgallery.sh,v 1.10 2012/08/29 10:52:35 as Exp $ # ARG_TITLE="PGallery" @@ -33,7 +33,7 @@ BIN_EXIFTRAN="/usr/local/bin/exiftran" BIN_EXIF="/usr/local/bin/exif" MKAKEFILE=".htmakefile" -VERSION="pgallery-1.1" +VERSION="pgallery-1.2" # # usage() @@ -458,9 +458,23 @@ get_exif_info() exifinfo="$exifinfo$exif " fi done - echo $exifinfo + echo $exifinfo | sed -e 's/ mm /mm /' -e 's/ sec./s/' -e 's/ ISO / ISO/' } +# +# is_in_list() +# +is_in_list() +{ + list=$1 + value=$2 + for entry in $list + do + test "$entry" = "$value" && return 0 + done + return 1 +} + # parse args while [ "$1" != "" ] do @@ -641,8 +655,25 @@ echo "tns: $targets" >> $MKAKEFILE make -f $MKAKEFILE rm $MKAKEFILE -# create single html files +# create html index index="" +for file in $FLIST +do + tn="${file}.tn.jpg" + imglink="${file}.html" + index="$index $(html_tn $tn $imglink)" +done +echo create html index +( + html_header + echo $index + echo "
" + echo "
$ARG_TITLE $ARG_COPYRIGHT
" + html_footer +) > $ARG_INDEX + +# create single html files +#test $ARG_UPDATE -eq 1 && FLIST="$FLIST_NEW $FLIST_UPDATE" i=0 echo -n "create single html files " for file in $FLIST @@ -651,7 +682,12 @@ do i=$(($i + 1)) j=$(($i + 1)) - tn="${file}.tn.jpg" + # is update mod and no new images founded + if [ $ARG_UPDATE -eq 1 -a "$FLIST_NEW" = "" ] + then + is_in_list "$FLIST_UPDATE" "$file" || continue + fi + big="${file}.big.jpg" imglink="${file}.html" @@ -663,7 +699,6 @@ do test "$linkn" != "" && linkn="$linkn.html" echo -n . - index="$index $(html_tn $tn $imglink)" ( html_header html_img $file $big $ARG_INDEX "$linkb" "$linkn" @@ -671,17 +706,6 @@ do ) > $imglink done echo - -# create html index -echo create html index -( - html_header - echo $index - echo "
" - echo "
$ARG_TITLE $ARG_COPYRIGHT
" - html_footer -) > $ARG_INDEX - test "$ARG_MAILTO" = "" && exit 0