From 2ea56722ee164229f7868f677d11472798c3089b Mon Sep 17 00:00:00 2001 From: "Paul Buetow (mars.fritz.box)" Date: Sun, 22 Dec 2013 12:31:05 +0100 Subject: fix --- photoalbum.conf | 5 +++-- photoalbum.sh | 20 ++++++++++---------- templates/preview.tmpl | 2 +- templates/view.tmpl | 8 ++++---- 4 files changed, 18 insertions(+), 17 deletions(-) diff --git a/photoalbum.conf b/photoalbum.conf index e80e5d6..defd59e 100644 --- a/photoalbum.conf +++ b/photoalbum.conf @@ -1,5 +1,5 @@ -set -e -set -x +#set -e +#set -x declare -i THUMBGEOMETRY=250 declare -i GEOMETRY=800 @@ -7,3 +7,4 @@ declare -i MAXPREVIEWS=100 declare -r TITLE='A simple Photoalbum' declare -r INCOMING=./incoming + diff --git a/photoalbum.sh b/photoalbum.sh index 215a8c5..6fe0232 100755 --- a/photoalbum.sh +++ b/photoalbum.sh @@ -23,11 +23,11 @@ function template () { } function scale () { - cd $INCOMING && find ./ -iname \*.jpg | sort | while read jpg; do - if [ ! -f "../photos/$jpg" ]; then - echo "Scaling $jpg" + cd $INCOMING && find ./ -type f | sort | while read photo; do + if [ ! -f "../photos/$photo" ]; then + echo "Scaling $photo" convert -auto-orient \ - -geometry $GEOMETRY "$jpg" "../photos/$jpg" + -geometry $GEOMETRY "$photo" "../photos/$photo" fi done @@ -47,8 +47,8 @@ function generate () { template header $name template header-first-add $name - cd photos && find ./ -iname \*.jpg | sort | sed 's;^\./;;' | - while read jpg; do + cd photos && find ./ -type f | sort | sed 's;^\./;;' | + while read photo; do : $(( i++ )) if [ $i -gt $MAXPREVIEWS ]; then @@ -73,10 +73,10 @@ function generate () { template view ${num}-${i} template footer ${num}-${i} - if [ ! -f "../thumbs/$jpg" ]; then - echo "Creating thumb for $jpg"; - convert -geometry x$THUMBGEOMETRY "$jpg" \ - "../thumbs/$jpg" + if [ ! -f "../thumbs/$photo" ]; then + echo "Creating thumb for $photo"; + convert -geometry x$THUMBGEOMETRY "$photo" \ + "../thumbs/$photo" fi done diff --git a/templates/preview.tmpl b/templates/preview.tmpl index a3bcfb5..a5e4bdc 100644 --- a/templates/preview.tmpl +++ b/templates/preview.tmpl @@ -1,3 +1,3 @@ cat < + END diff --git a/templates/view.tmpl b/templates/view.tmpl index 5bc6df9..abf577a 100644 --- a/templates/view.tmpl +++ b/templates/view.tmpl @@ -1,12 +1,12 @@ cat <<<< -Thumbnails +Thumbnails >>>

- +

-Direct link -

$jpg

+Direct link +

$photo

END -- cgit v1.2.3