chiark / gitweb /
locale-exists: New script to test whether a given locale exists on the
[bin.git] / skeleton-gallery
1 #! /bin/sh
2 set -e
3
4 exec >gallery.xml
5
6 cat <<EOF
7 <gallery title="" perpage=""
8          authorname="Colin Watson" authoremail="cjwatson@flatline.org.uk">
9 EOF
10
11 index=0
12
13 for x in *.jpg; do
14     index=$(($index + 1))
15     if [ "$index" -ne 1 ]; then
16         echo
17     fi
18     printf '  <photo id="%d"' "$index"
19     identify "$x" | \
20         perl -ne '/(\d+)x(\d+)/ and print qq{ width="$1" height="$2"}'
21     cat <<EOF
22 >
23     <p></p>
24   </photo>
25 EOF
26 done
27
28 cat <<EOF
29 </gallery>
30
31 <!-- vim: set tw=76 sts=2 sw=2 et: -->
32 EOF