Crufty Gallery: Photo Album Tools
The lastest version of this page can be found at:
http://www.crufty.net/gallery/tools
The slides in this gallery were generated using the tools described below.
Most of the pics here are digital.
If I were writing this again I'd be tempted to do it in Python, but a
shell script copes ok - ImageMagick does the heavy lifting. This is
actually about my 3rd generation of this sort of script. It was
inspired in part by viewing albums on pbase.com. I looked at (and
liked) JAlbum, but being written in Java it could not handle the
symlinks I use in my workflow (to allow the same image to show up in
multiple collections).
Eventually I'd like to do a setup something like photo.net but in
python rather than tcl, plone might be a good starting point but with
all the pics still stored on FS and only metadata stored in the zope
db. This would allow one collection of pics to be presented in
multiple views based on viewer's authorization/preferences. It would
also facilitate searching for particular images.
pictool.py
This script is still in its early days, but allows me to quickly proof
images while recording their rotation requirements (I never
touch the original image from the camera).
Actually I don't even need to use this anymore - at least for pics
taken with my Canon, since the EXIF data includes image rotation, so
adding new pics to my collection is a simple batch job.
exif.py
I'll eventually incorporate this into pictool, but for now I run it
via a simple shell script to extract a one line EXIF summary of each
image which picalbum incorporates into the slides it generates.
Eg. Canon EOS 20D, 17-85 @ 22mm, 1/125s f/11 ISO 800
As mentioned above, this same job extracts image rotation data for use
by picalbum.sh
getexif
This is how I typically run exif.py, it finds all the jpegs "pic".jpg
and if the file "pic".exif1 is missing, uses exif.py to create it.
As a side effect, it extracts rotation info (from images that record
it) into .rotate for use by picalbum.
workflow
I copy the pics of the CF card to say /pics/YYYY/mm/ and run
mpics.pl to rename them to YYYYmmddNNN.jpg (or .cr2 etc).
I used to use just 2 digits to sequence pics taken the same day, but
that proved inadequate once I got my DSLR ;-)
I then run getexif to generate the YYYYmmddNNN.exif1 files which
provide a summary of the EXIF data (for jpegs) and also extracts
rotation data to .rotate (if it exists).
If the pics do not contain rotation data, I need to use pictool.py to
examine them and record the rotation data.
I run picalbum.sh to generate the YYYYmmddNNN-w.jpg scaled image and
YYYYmmddNNN-t.jpg thumbnail (it uses ImageMagic) and YYYYmmddNNN.htm
slides for each image as well as an index.htm which uses the
thumbnails.
For some images - especially those I plan to link into the more public
collections (using grab-pics.sh), I put some description into
YYYYmmddNNN.txt and if needed re-run picalbum.sh
Image manipulation
I apply moderate sharpening when generating the -w.jpg and -t.jpg
files, but I never touch the original image from the camera.
On the very rare occasion that I want to tweak an image, I move the
original into ./raw and modify a copy.
Download
You can grab most of the above from
pictools.tar.gz
Some of the simpler scripts are not intended to be generally useful,
just give examples of what can be done.
Simon J. Gerraty
Copyright © 2003-2006