Gallery on paulduncan.org

Jan 11, 2004

I finally finished the new gallery page on paulduncan.org. Rather than port the Pablotron Gallery directly, I decided to start from scratch and see if I could do it better the second time around. I also had a bunch of pictures at home to work with and some slightly different requirements. All my camera pictures at home are in /store/camera, but I wanted to split the files up by gallery on the server-side. Also, I wanted a straightforward way to edit captions. Above all, I wanted the entire setup to be simple to maintain.

Well, I think I've managed to accomplish all that. At home, I'm using the new caption mode in feh to caption images, and the server-side gallery code recognizes feh captions. A single config file, galleries.yaml, tells the web interface and gallery generating script the title, path, description and images associated with each gallery. The server-side gallery generation script reads galleries.yaml, creates the gallery directory structure, and populates it with symlinks to an rsynced copy of the camera directory. At home, camera_update.sh generates thumbnails (via ImageMagick) and rsyncs the camera directory to kylie.

So, to create a new gallery, I do the following:

Add the images to /store/camera

Caption the images with feh -T camera

Run camera_update.sh

Add the description to galleries.yaml

Run generate_galleries.rb

Note that I already put the pictures in /store/camera. And they have to captioned, scaled, and uploaded somehow. So steps 1, 2, and 3 are effectively NOOPs. That said, I'm trying to think of ways to make this process even dumber. I could cron the camera update and rsync process; that way thumbnails and data transfer are taken care of automatically. Thoughts, anyone?

Oh yeah, if you want any of this code, let me know and I'll post it.
It's written with my setup in mind, but you might be able to salvage or
modify it for your setup. Here's the first review of the code: