summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow (mars.fritz.box) <paul@buetow.org>2013-12-22 12:17:31 +0100
committerPaul Buetow (mars.fritz.box) <paul@buetow.org>2013-12-22 12:17:31 +0100
commit21a4bd6feee001e676db7526a7a5598b8ddcbdb7 (patch)
tree6249737299696bc0daac2de78f83f410de9b04e2
parent9b1d56f69b469b91c711ffd4248aafdb7c1bff45 (diff)
handle files containing spaces
-rwxr-xr-xphotoalbum.sh10
1 files 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 |