From 21a4bd6feee001e676db7526a7a5598b8ddcbdb7 Mon Sep 17 00:00:00 2001 From: "Paul Buetow (mars.fritz.box)" Date: Sun, 22 Dec 2013 12:17:31 +0100 Subject: handle files containing spaces --- photoalbum.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/photoalbum.sh b/photoalbum.sh index 6265304..93ffbff 100755 --- a/photoalbum.sh +++ b/photoalbum.sh @@ -27,9 +27,15 @@ function scale () { if [ ! -f "../photos/$jpg" ]; then echo "Scaling $jpg" convert -auto-orient \ - -geometry $GEOMETRY "$jpg" "../photos/$jpg;" + -geometry $GEOMETRY "$jpg" "../photos/$jpg" fi done + + echo 'Removing spaces from file names' + find ../photos -type f -name '* *' | while read file; do + rename 's/ /_/g' "$file" + done + cd .. } @@ -74,8 +80,8 @@ function generate () { "../thumbs/$jpg" fi done - cd .. + cd .. template footer $(cd html;ls -t page-*.html | head -n 1 | sed 's/.html//') ls html/*.html | grep -v page- | cut -d'-' -f1 | uniq | -- cgit v1.2.3