Clone wiki

terbium / TerbiumBackstory

How Terbium Came To Be

Once upon a time, I had a variety of images I wanted to share on a website. I just wanted to have them visible, grouped by event, or subject matter. I certainly didn't want to hand generate display pages.

Displaying them on a website was obviously a programmatic task. I wanted a lot of flexibility in the presentation, and ended up implementing my gallery as a Gallery (1.0) site. PHP on a web server didn't seem so bad to me.

As time went by, management of it became annoying. Not only this but it seemed slow. And kludgey. I ended up with a few custom hacks to the PHP code to get what I wanted.

I realised that I didn't need a dynamic web application; very little aside from the web-facing management needed authentication, and I was doing most of the image manipulation outside of the interface. I wanted something that could be browsed light and fast. As I thought about it more, the notion of a static gallery again came to the forefront. I went looking for applications. I found BINS.

BINS

It sufficed. For a while. I have no great love for Perl, but I don't hate it either. And BINS seemed to work okay. I spent some time tweaking a custom template, and my gallery was happy again. The generated pages weren't exactly light, but they were better than with Gallery1.

Over time it became painfully obvious that BINS was insufficient. Whenever a change was made to the source files, the whole output tree was essentially regenerated. Given the size of my gallery, making any changes (adding a single image or a few dozen) ended up costing close to an hour of processing time. I had a few other problems with BINS as well. It was a massive memory hog, requiring gigs of memory to perform the processing. It also forcibly created a .xml meta-data file for every image in the source directory, filled with data that was already in the EXIF headers of the image files themselves. Wasteful of space and duplicative of processing as the image headers were still read any how.

I grumbled along with BINS for a while, hacking it a bit to reduce the memory footprint. But it was still a bit of an odd fit with the way I wanted the gallery to be generated (and the hour-long rebuilds didn't help). Since I'm a python-hacker-wannabe, I decided I'd try to create my own static gallery generator that was fast (adding a single image to the output takes under a minute), relatively lightweight (a full rebuild of my 10000 image gallery peaks at about 60M of memory), and used a familiar (to me) templating mechanism (I'd used Django other places, and like the way it handles templates).

I didn't immediately need a lot of the excess stuff that BINs brought along with it. Image searches, and tree views, for example. I also wanted much simpler HTML output.

The result is Terbium.

Updated