Gallery on paulduncan.org

January 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:

  1. Add the images to /store/camera
  2. Caption the images with feh -T camera
  3. Run camera_update.sh
  4. Add the description to galleries.yaml
  5. 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:

17:52 <giblet> dammit, that's cool
17:53 <giblet> well I'm pissed off now :D
17:53 <pabs> alright!
17:53 <giblet> cos I can't do that without copying images :D
17:53 <pabs> just call me master of symlinks
17:53 <pabs> pabs@kylie:~/paulduncan.org/gallery> du -sh .
17:53 <pabs> 496K    .
17:54 <giblet> hehehe
17:54 <giblet> I should've thought of that :)