summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Buetow (mars.fritz.box) <paul@buetow.org>2013-12-29 15:14:49 +0100
committerPaul Buetow (mars.fritz.box) <paul@buetow.org>2013-12-29 15:14:49 +0100
commit90ce40e61fcd54b6ec67467de17fd04224139066 (patch)
tree470b7536a46ab49ceca5abda8d971a8499658347 /src
parent7422d3fc0029196b3b34f594a7a26f1277176caf (diff)
Q: How many Harvard MBA's does it take to screw in a light bulb?
A: Just one. He grasps it firmly and the universe revolves around him.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/photoalbum49
-rw-r--r--src/photoalbum.default.conf4
2 files changed, 29 insertions, 24 deletions
diff --git a/src/photoalbum b/src/photoalbum
index 47c062f..e3210ad 100755
--- a/src/photoalbum
+++ b/src/photoalbum
@@ -6,7 +6,7 @@ declare -r VERSION='0.0.0'
function usage () {
cat - <<USAGE >&2
Usage:
- $0 [clean|init|version|generate]
+ $0 [clean|init|version|generate|all]
USAGE
}
@@ -22,19 +22,19 @@ function clean () {
}
function generate () {
- if [ ! -d "${INCOMING_DIR}" ]; then
- echo "ERROR: You may run init first, no such directory: ${INCOMING_DIR}" >&2
- exit 1
- fi
- if [ ! -d "${DIST_DIR}" ]; then
- echo "ERROR: You may run init first, no such directory: ${DIST_DIR}" >&2
- exit 1
- fi
-
- scale
- find "${DIST_DIR}/html" -type f -name \*.html -delete
- makedist 1
- template index ../index
+ if [ ! -d "${INCOMING_DIR}" ]; then
+ echo "ERROR: You may run init first, no such directory: ${INCOMING_DIR}" >&2
+ exit 1
+ fi
+ if [ ! -d "${DIST_DIR}" ]; then
+ echo "ERROR: You may run init first, no such directory: ${DIST_DIR}" >&2
+ exit 1
+ fi
+
+ scale
+ find "${DIST_DIR}/html" -type f -name \*.html -delete
+ makedist 1
+ template index ../index
}
function template () {
@@ -55,7 +55,7 @@ function scale () {
destphoto="${photo}"
fi
- destphoto="${destphoto//./}"
+ destphoto="${destphoto/./}"
echo "Scaling ${photo} to ${DIST_DIR}/photos/${destphoto}"
@@ -81,29 +81,29 @@ function makedist () {
cd "${DIST_DIR}/photos" && find ./ -type f | sort | sed 's;^\./;;' |
while read photo; do
: $(( i++ ))
-
+
if [ ${i} -gt ${MAXPREVIEWS} ]; then
i=1
: $(( num++ ))
-
+
next=page-${num}
template next ${name}
template footer ${name}
-
+
prev=${name}
name=${next}
template header ${name}
template prev ${name}
fi
-
+
# Preview page
template preview ${name}
-
+
# View page
template header ${num}-${i}
template view ${num}-${i}
template footer ${num}-${i}
-
+
if [ ! -f "${DIST_DIR}/thumbs/${photo}" ]; then
echo "Creating thumb for ${photo}";
convert -geometry x${THUMBGEOMETRY} "${photo}" \
@@ -136,7 +136,7 @@ function makedist () {
redirectpage=1-1
fi
- template redirect ${next}redirect
+ template redirect ${nextredirect}
done
}
@@ -147,6 +147,11 @@ if [ -f ~/.photoalbumrc ]; then
fi
case "${ARG1}" in
+ all)
+ clean
+ init
+ generate
+ ;;
init)
init
;;
diff --git a/src/photoalbum.default.conf b/src/photoalbum.default.conf
index 6fba763..20ac490 100644
--- a/src/photoalbum.default.conf
+++ b/src/photoalbum.default.conf
@@ -12,6 +12,6 @@ DIST_DIR=$(pwd)/dist
TEMPLATE_DIR=/usr/share/photoalbum/templates
# Some debugging options
-set -e
-set -x
+#set -e
+#set -x