--- scripts/pgallery/src/pgallery.sh 2012/08/31 12:33:07 1.18 +++ scripts/pgallery/src/pgallery.sh 2012/09/11 15:40:43 1.22 @@ -1,11 +1,11 @@ -#!/bin/sh +#!/home/as/sh # # THE BEER-WARE LICENSE 2012 # wrote this file. As long as you retain this notice you # 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.17 2012/08/29 14:44:04 as Exp $ +# $Paefchen: scripts/pgallery/src/pgallery.sh,v 1.21 2012/08/31 15:58:03 as Exp $ # . $(dirname $0)/libpgallery @@ -26,6 +26,9 @@ ARG_MAILFROM="PGallery <${USER}@${HOST}>" ARG_URL= ARG_EXIF="0x920a 0x829d 0x829a ISO 0x8827 / 0x010f - 0x0110" ARG_INDEXIMG= +ARG_STARTTS= +ARG_ENDTS= +ARG_LINK= MKAKEFILE=".htmakefile" @@ -36,7 +39,7 @@ usage() { cat <] | [-s ] ) [-d ] [-n ] - [-t ] [-u ] + [-t ] [-u ] [-H ] [-b ] [-c ] [-l link] [-e ] [-i ] [-C ] [-F ] [-T ] [-U] | -h | -v @@ -60,11 +63,12 @@ Options: -v print version -C copyright copyright (html) string (default: $ARG_COPYRIGHT) -F from mail sender (default: $ARG_MAILFROM) + -L link optional home link -I file info text file for pgallery. info file paras prefered. the syntax of the file is MAKE(1) supported variable: TITLE COPYRIGHT INDEX FILETYPES TNSIZE URL TNQALITY BIGSIZE BIGQALITY MAILTO MAILFROM - EXIF INDEXIMG + EXIF INDEXIMG LINK -T mailto send update infos to this address. if not set, no mail delivery -U no update, new calculation of all images. normally only new and modified images will calculated @@ -84,8 +88,6 @@ do test $arg = -d && is_dir=1 done -echo $ARG_DIR - # load save args if [ -f "$ARG_DIR/$ARGFILE" ] then @@ -137,6 +139,9 @@ do -F) ARG_MAILFROM=$1 shift;; + -L) + ARG_LINK=$1 + shift;; -I) ARG_INFOFILE=$1 shift;; @@ -163,7 +168,7 @@ if [ "$ARG_INFOFILE" != "" ] then test -f $ARG_INFOFILE || err "info file not found \`\`$ARG_INFOFILE''" for n in TITLE COPYRIGHT INDEX FILETYPES TNSIZE TNQALITY BIGSIZE \ - BIGQALITY MAILTO MAILFROM URL EXIF INDEXIMG + BIGQALITY MAILTO MAILFROM URL EXIF INDEXIMG LINK do v=$(make -f $ARG_INFOFILE -V$n) test "$v" = "" && continue @@ -225,6 +230,10 @@ FLIST=$( # if no master image, we use the first one test "$ARG_INDEXIMG" = "" && ARG_INDEXIMG=$(echo $FLIST | awk '{print $1}') +# find start and end ts +ARG_STARTTS=$(get_exif_ts $(echo $FLIST | awk '{print $1}')) +ARG_ENDTS=$(get_exif_ts $(echo $FLIST | awk '{print $NF}')) + # find new and to update images FLIST_NEW= FLIST_UPDATE= @@ -306,17 +315,27 @@ make -f $MKAKEFILE rm $MKAKEFILE # 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 + + startdate= + test $ARG_STARTTS -ne -1 && startdate=$(date -r $ARG_STARTTS "+%d.%m.%Y") + enddate= + test $ARG_ENDTS -ne -1 && enddate=$(date -r $ARG_ENDTS "+%d.%m.%Y") + date= + test "$startdate" != "" && date="$startdate" + test "$enddate" != "$startdate" && date="$date - $enddate" + link= + test "$ARG_LINK" != "" && link="overview" + html_title "$ARG_TITLE" "$link" "$date" + + for file in $FLIST + do + tn="${file}.tn.jpg" + imglink="${file}.html" + html_tn $tn $imglink + done echo "
" echo "
$ARG_TITLE $ARG_COPYRIGHT
" html_footer