Automat

Automat is an extremely lightweight photo album generator that I wrote after an evening of trying to build a photo album for about 1400 baby pictures and not having any luck with any of the free software I could find. I eventually lost patience and wrote my own program instead.

Automat consists of two programs; mkindex, which is used to generate the initial photo album, and updindex, which is used to merge new folders into the existing album. Both programs require awk and sed, which can be found on just about every UNIX® box out there, plus the netpbm tools, libjpeg and libpng.

To install it, get a current tarball and unpack it somewhere on your system. Run configure.sh to configure it, then do a make install.

To use automat, cd to the root of your photo album and type

mkindex /list of files or folders/

Mkindex will go off and build thumbnails and index pages for every folder containing jpeg or png images that it can find in your photo album. This may take a long time – I have approximately a gigabyte of baby pictures and it takes approximately 45 minutes to index everything. Later, as you add new folders containing images, you can get them into the album by cd'ing to the directory containing the new folder and doing

updindex

there.

Automat allows some small degree of customization to photo albums. It uses the file .title in each folder to set the title of the index page for that folder, and it copies the contents of the file .header into the index page before the thumbnail list and the contents of the file .footer into the index page after the thumbnail list. When it runs, it generates thumbnail files named .number.jpg, and reduced size images (if the original photo is larger than 640x480) named .number-size.jpg. (You may customise the size of the reduced size image, as well as a few other things, when you run*configure.sh.)

If you have php in your web server, you can configure automat to (pretend to) take advantage of it; the --with-php option tells automat to generate a view.php file in each album – this viewer allows you to go between pictures in an album without having to back up to the album and select new pictures. Currently (Oct 21, 2002) the viewer has all the names of the pictures hardcoded into it, but that particular whopping kludge is going to be replaced with a dbm (or the like) database which mkindex, updindex, view.php, and any other support routines I might wish to write can manipulate in a slightly less painful manner.

Source Code

version 0.4
Oct 23, 2002 gets a new version, with some more tiny tweaks. I’ve redone the thumbnail and screen generator to be more object-oriented; it’s now done by one function that makes thumbnails, reduced resolution screen pictures if needed, and the entry in the index file, and the only thing that’s format specific that I need to pass in is the name of a converter routine that converts the image format to the internal (ppm one.)
version 0.2
Automat for Oct 21, 2002, with navigation buttons, a php viewer, and configuration via my autoconfiguration scripts. Marvel at the (*cough*) object-orientedness of this piece of /bin/sh code.
version 0.1
Automat for Oct 20, 2002. This is the first cut, and it’s not extraordinarily robust, configurable, or maintainable.