summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--photoalbum.conf5
-rwxr-xr-xphotoalbum.sh20
-rw-r--r--templates/preview.tmpl2
-rw-r--r--templates/view.tmpl8
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
-<a name='$jpg' href='../html/${num}-${i}.html'><img border='0' src='../thumbs/$jpg' /></a>
+<a name='$photo' href='../html/${num}-${i}.html'><img border='0' src='../thumbs/$photo' /></a>
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 <<END
<a href="${num}-$((i-1)).html">&lt;&lt;&lt;</a>
-<a href="page-${num}.html#$jpg">Thumbnails</a>
+<a href="page-${num}.html#$photo">Thumbnails</a>
<a href="${num}-$((i+1)).html">&gt;&gt;&gt;</a>
<br />
<br />
-<a href="${num}-$((i+1)).html"><img border='0' src='../photos/$jpg' /></a>
+<a href="${num}-$((i+1)).html"><img border='0' src='../photos/$photo' /></a>
<br />
<br />
-<a href="../photos/$jpg">Direct link</a>
-<h3>$jpg</h3>
+<a href="../photos/$photo">Direct link</a>
+<h3>$photo</h3>
END