--- scripts/pgallery/src/pgallery.sh 2012/08/31 15:58:03 1.21 +++ scripts/pgallery/src/pgallery.sh 2013/04/03 08:06:44 1.26 @@ -1,14 +1,16 @@ -#!/home/as/sh +#!/usr/local/libexec/pgallerysh # -# THE BEER-WARE LICENSE 2012 +# THE BEER-WARE LICENSE 2012,13 + # 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.20 2012/08/31 15:52:10 as Exp $ +# $Paefchen: scripts/pgallery/src/pgallery.sh,v 1.25 2012/09/11 16:47:16 as Exp $ # -. $(dirname $0)/libpgallery +. /usr/local/libexec/libpgallery + ARG_TITLE="PGallery" ARG_FILES= ARG_FILETYPES="jpg jpeg png gif tif tiff" @@ -29,6 +31,7 @@ ARG_INDEXIMG= ARG_STARTTS= ARG_ENDTS= ARG_LINK= +ARG_NAVI=0 MKAKEFILE=".htmakefile" @@ -42,7 +45,7 @@ usage $0: ( [-f ] | [-s ] ) [-d ] [-t ] [-u ] [-H ] [-b ] [-c ] [-l link] [-e ] [-i ] [-C ] [-F ] [-T ] - [-U] | -h | -v + [-U] [-w] | -h | -v Options: -b size size from big images in pixel (default: $ARG_BIGSIZE) -c quality quality from big images 0-100% (default: $ARG_BIGQALITY) @@ -61,6 +64,7 @@ Options: -t size size from thumbnail images in pixel (default: $ARG_TNSIZE) -u quality quality from thumbnail images 0-100% (default: $ARG_BIGQALITY) -v print version + -w enable navi width link in the overview -C copyright copyright (html) string (default: $ARG_COPYRIGHT) -F from mail sender (default: $ARG_MAILFROM) -L link optional home link @@ -68,7 +72,7 @@ Options: the syntax of the file is MAKE(1) supported variable: TITLE COPYRIGHT INDEX FILETYPES TNSIZE URL TNQALITY BIGSIZE BIGQALITY MAILTO MAILFROM - EXIF INDEXIMG LINK + EXIF INDEXIMG LINK NAVI -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 @@ -153,6 +157,8 @@ do -v) echo $VERSION exit;; + -w) + ARG_NAVI=1;; *) echo "unknown argument $arg" exit @@ -168,7 +174,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 LINK + BIGQALITY MAILTO MAILFROM URL EXIF INDEXIMG LINK NAVI do v=$(make -f $ARG_INFOFILE -V$n) test "$v" = "" && continue @@ -180,7 +186,7 @@ fi for n in $(set | awk -F= '{print $1}') do echo "$n" | grep -q '^ARG_' || continue - eval "$n=\"\$(echo \"\$$n\" | iconv -f ISO-8859-1 -t UTF-8)\"" + eval "$n=\"\$(echo \"\$$n\" | $BIN_ICONV -f ISO-8859-1 -t UTF-8)\"" done # fix url @@ -203,12 +209,13 @@ else FLIST="$ARG_FILES" fi -# Filter big and thumbnails +# Filter big, thumbnails and curipted images echo -n "find images" FLISTF= for file in $FLIST do test $(echo $file | grep -E '\.(tn|big)\.jpg$') && continue + test $($BIN_JPEGINFO $file | grep -Eq 'WARNING|ERROR') && continue FLISTF="$FLISTF $file" echo -n " $file" done @@ -266,6 +273,7 @@ echo "save settings" set | while read n do echo "$n" | grep -q '^ARG_' || continue + echo "$n" | grep -q '^ARG_UPDATE' && continue echo "$n" >> $ARGFILE done @@ -311,7 +319,7 @@ MAKE done echo "tns: $targets" >> $MKAKEFILE -#make -f $MKAKEFILE +make -f $MKAKEFILE rm $MKAKEFILE # create html index