--- /dev/null
+#! /bin/sh
+set -e
+
+exec >gallery.xml
+
+cat <<EOF
+<gallery title="" perpage=""
+ authorname="Colin Watson" authoremail="cjwatson@flatline.org.uk">
+EOF
+
+index=0
+
+for x in *.jpg; do
+ index=$(($index + 1))
+ if [ "$index" -ne 1 ]; then
+ echo
+ fi
+ printf ' <photo id="%d"' "$index"
+ identify "$x" | \
+ perl -ne '/(\d+)x(\d+)/ and print qq{ width="$1" height="$2"}'
+ cat <<EOF
+>
+ <p></p>
+ </photo>
+EOF
+done
+
+cat <<EOF
+</gallery>
+
+<!-- vim: set tw=76 sts=2 sw=2 et: -->
+EOF