version 1.20, 2012/08/31 15:52:10
|
version 1.27, 2013/04/03 08:14:52
|
Line 1
|
Line 1
|
#!/home/as/sh | #!/usr/local/libexec/pgallerysh |
# |
# |
# THE BEER-WARE LICENSE 2012 | # THE BEER-WARE LICENSE 2012,13 |
| # |
# <as@paefchen.net> wrote this file. As long as you retain this notice you |
# <as@paefchen.net> 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 |
# 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 |
# this stuff is worth it, you can buy me a beer in return Aron Schlesinger |
# |
# |
# $Paefchen: scripts/pgallery/src/pgallery.sh,v 1.19 2012/08/31 14:26:58 as Exp $ | # $Paefchen: scripts/pgallery/src/pgallery.sh,v 1.26 2013/04/03 08:06:44 as Exp $ |
# |
# |
. $(dirname $0)/libpgallery |
|
|
|
|
. /usr/local/libexec/libpgallery |
|
|
ARG_TITLE="PGallery" |
ARG_TITLE="PGallery" |
ARG_FILES= |
ARG_FILES= |
ARG_FILETYPES="jpg jpeg png gif tif tiff" |
ARG_FILETYPES="jpg jpeg png gif tif tiff" |
Line 29 ARG_INDEXIMG=
|
Line 31 ARG_INDEXIMG=
|
ARG_STARTTS= |
ARG_STARTTS= |
ARG_ENDTS= |
ARG_ENDTS= |
ARG_LINK= |
ARG_LINK= |
|
ARG_NAVI=0 |
|
|
MKAKEFILE=".htmakefile" |
MKAKEFILE=".htmakefile" |
|
|
Line 42 usage $0: ( [-f <files>] | [-s <suffix>] ) [-d <dir>]
|
Line 45 usage $0: ( [-f <files>] | [-s <suffix>] ) [-d <dir>]
|
[-t <thumbnail_size>] [-u <thumbnail_quality>] [-H <link>] |
[-t <thumbnail_size>] [-u <thumbnail_quality>] [-H <link>] |
[-b <big_size>] [-c <big_quality>] [-l link] [-e <exif>] |
[-b <big_size>] [-c <big_quality>] [-l link] [-e <exif>] |
[-i <index>] [-C <copyright>] [-F <mailfrom>] [-T <mailto>] |
[-i <index>] [-C <copyright>] [-F <mailfrom>] [-T <mailto>] |
[-U] | -h | -v | [-U] [-w] | -h | -v |
Options: |
Options: |
-b size size from big images in pixel (default: $ARG_BIGSIZE) |
-b size size from big images in pixel (default: $ARG_BIGSIZE) |
-c quality quality from big images 0-100% (default: $ARG_BIGQALITY) |
-c quality quality from big images 0-100% (default: $ARG_BIGQALITY) |
Line 61 Options:
|
Line 64 Options:
|
-t size size from thumbnail images in pixel (default: $ARG_TNSIZE) |
-t size size from thumbnail images in pixel (default: $ARG_TNSIZE) |
-u quality quality from thumbnail images 0-100% (default: $ARG_BIGQALITY) |
-u quality quality from thumbnail images 0-100% (default: $ARG_BIGQALITY) |
-v print version |
-v print version |
|
-w enable navi width link in the overview |
-C copyright copyright (html) string (default: $ARG_COPYRIGHT) |
-C copyright copyright (html) string (default: $ARG_COPYRIGHT) |
-F from mail sender (default: $ARG_MAILFROM) |
-F from mail sender (default: $ARG_MAILFROM) |
-L link optional home link |
-L link optional home link |
Line 68 Options:
|
Line 72 Options:
|
the syntax of the file is MAKE(1) |
the syntax of the file is MAKE(1) |
supported variable: TITLE COPYRIGHT INDEX FILETYPES TNSIZE URL |
supported variable: TITLE COPYRIGHT INDEX FILETYPES TNSIZE URL |
TNQALITY BIGSIZE BIGQALITY MAILTO MAILFROM |
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 |
-T mailto send update infos to this address. if not set, no mail delivery |
-U no update, new calculation of all images. |
-U no update, new calculation of all images. |
normally only new and modified images will calculated |
normally only new and modified images will calculated |
Line 88 do
|
Line 92 do
|
test $arg = -d && is_dir=1 |
test $arg = -d && is_dir=1 |
done |
done |
|
|
echo $ARG_DIR |
|
|
|
# load save args |
# load save args |
if [ -f "$ARG_DIR/$ARGFILE" ] |
if [ -f "$ARG_DIR/$ARGFILE" ] |
then |
then |
Line 155 do
|
Line 157 do
|
-v) |
-v) |
echo $VERSION |
echo $VERSION |
exit;; |
exit;; |
|
-w) |
|
ARG_NAVI=1;; |
*) |
*) |
echo "unknown argument $arg" |
echo "unknown argument $arg" |
exit |
exit |
Line 170 if [ "$ARG_INFOFILE" != "" ]
|
Line 174 if [ "$ARG_INFOFILE" != "" ]
|
then |
then |
test -f $ARG_INFOFILE || err "info file not found \`\`$ARG_INFOFILE''" |
test -f $ARG_INFOFILE || err "info file not found \`\`$ARG_INFOFILE''" |
for n in TITLE COPYRIGHT INDEX FILETYPES TNSIZE TNQALITY BIGSIZE \ |
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 |
do |
v=$(make -f $ARG_INFOFILE -V$n) |
v=$(make -f $ARG_INFOFILE -V$n) |
test "$v" = "" && continue |
test "$v" = "" && continue |
Line 178 then
|
Line 182 then
|
done |
done |
fi |
fi |
|
|
#paras from iso to utf-8 | # paras from iso to utf-8 |
for n in $(set | awk -F= '{print $1}') |
for n in $(set | awk -F= '{print $1}') |
do |
do |
echo "$n" | grep -q '^ARG_' || continue |
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 |
done |
|
|
# fix url |
# fix url |
Line 205 else
|
Line 209 else
|
FLIST="$ARG_FILES" |
FLIST="$ARG_FILES" |
fi |
fi |
|
|
# Filter big and thumbnails | # Filter big, thumbnails and curipted images |
echo -n "find images" |
echo -n "find images" |
FLISTF= |
FLISTF= |
for file in $FLIST |
for file in $FLIST |
do |
do |
test $(echo $file | grep -E '\.(tn|big)\.jpg$') && continue |
test $(echo $file | grep -E '\.(tn|big)\.jpg$') && continue |
|
test $($BIN_JPEGINFO $file | grep -Eq 'WARNING|ERROR') && continue |
FLISTF="$FLISTF $file" |
FLISTF="$FLISTF $file" |
echo -n " $file" |
echo -n " $file" |
done |
done |
Line 268 echo "save settings"
|
Line 273 echo "save settings"
|
set | while read n |
set | while read n |
do |
do |
echo "$n" | grep -q '^ARG_' || continue |
echo "$n" | grep -q '^ARG_' || continue |
|
echo "$n" | grep -q '^ARG_UPDATE' && continue |
echo "$n" >> $ARGFILE |
echo "$n" >> $ARGFILE |
done |
done |
|
|
Line 313 MAKE
|
Line 319 MAKE
|
done |
done |
echo "tns: $targets" >> $MKAKEFILE |
echo "tns: $targets" >> $MKAKEFILE |
|
|
#make -f $MKAKEFILE | make -f $MKAKEFILE |
rm $MKAKEFILE |
rm $MKAKEFILE |
|
|
# create html index |
# create html index |