This is the program I use to generate and maintain my image gallery. It requires Python and the Python Imaging Library.
It seems like everyone's written one of these. This one's mine.
The program generates only static HTML. Thumbnails link directly to their respective pictures, not to another web page with the picture inside. Medium-sized versions of pictures are generated when the original picture is bigger than a certain threshold (see medium_size).
The program reads a file (by default gallery.def) in the current directory. The file may contain variable definitions, image references, links, and comments.
A variable definition looks like
set name = value
You can set the following variables to alter the behavior of the program:
An image reference looks like
image filename description
This causes the program to generate a thumbnail of the image and include it in the output with description. description may be omitted. If filename is image.jpg, the name of the thumbnail file will be image-sm.jpg. If a thumbnail already exists and is the right size, it will not be regenerated.
If any dimension of the image is greater than medium_size, a medium-sized image is generated and linked to instead. The original image is never modified. If filename is image.jpg, the name of the medium-sized image will be image-md.jpg.
If your file name contains spaces, you may surround it with double quotes.
A link looks like
link filename
This will create a link to another gallery defined in filename. The link text will be the title of the linked gallery. The linked gallery will have a link back to the linking gallery.
Linked galleries inherit the values of the linking gallery's variables, except prologue and epilogue.
A comment looks like
# Comment
The # must be the first non-whitespace character on the line.
Run gallery.py, giving it the names of your gallery definition files as arguments. If you don't provide any, the program will look for gallery.def.
gallery.py accepts these command-line flags:
For examples see my image gallery. For every index.html in the directory tree there is a gallery.def that was used to generate it.
Updating a gallery on a remote server is easy with
rsync. Use something like
rsync -v -r -l -t -e ssh --delete ./
user@host:/var/httpd/images/
Download gallery.py.