Scripted workflow for preparing images

I’ve finally written a very small shell script to prepare my Digital Rebel photos for web posting. I used to do this manually, but that’s just silly.

I shoot in fine-resolution JPEG, which results in images 3072×2048 (landscape) – pretty huge for a web gallery. I’ve found that shrinking them down to 2048×1365 results in a decent sized file. In addition, Coppermine Gallery can create good looking thumbnails from these images – if I shrink the images too much, the thumbnails turn to crap.

Because I’m too busy, I don’t spend much time editing in The Gimp. If I screw it up badly when I click the shutter, I probably won’t bother fixing it after the fact. I could shoot in Canon Raw, but the files are too huge. I’ve already bought a tape drive for backups – I’d rather not buy a tape loader.

The process involves two steps:

  1. resize for the web
  2. rotate if not already in landscape orientation

The images are resized using convert from the ImageMagick package. Using the following syntax, I am able to resize to no side longer than 2048 pixels:

convert -resize ‘2048×2048>’ origfile.jpg newfile.jpg

In the second step, I use jhead to rotate based on the EXIF Orientation tag. If the image is not already set to normal orientation (orientation = 1), the image is rotated by jpegtran. The syntax is:

jhead -autorot newfile.jpg

The end result is an image no longer than 2048 pixels on a side, and properly oriented.

Coppermine Gallery Installed

Installed Coppermine gallery yesterday. It was really easy – more so than WordPress, since I had already beaten MySQL and php-mysql into submission.

My only regret: I’m not entirely sure where the disk footprint will reside. I use LVM, so I can resize things a bit as necessary, but I’d rather plan the installation accordingly up front.

I probably shouldn’t worry about this — I’ve plenty of disk space, as long as I don’t post every photo I’ve taken with my Digital Rebel.

Web Gallery

Now that I’ve got WordPress installed in the DMZ, it’s time to add a web gallery.

I’m leaning towards Coppermine. It’s requirements are similar to those of WP (at least the Web Server + PHP + MySQL part), so it should not be a big deal.

The real reason I want a gallery? Our first child is due September 21st. I expect I’ll have a few photos to share in the next little while.