How a Software Engineer Puts Together a Wedding Album

With our wedding three months behind us, the time has arrived to place our wedding album order. I’m not sure how a normal person would go about figuring out which layouts work with which photos, but I can tell the story of how a Software Engineer, myself, went about the process.

Prep Work

When we had met with Timothy Whaley & Associates back in September, we were given:

  • Our proof book (a 12 × 11 inch book with 12 wallet sized photographs on a page)
  • A mat guide (a 8 × 11 inch sheet of paper with 35 little images of what each album page would look like)
  • And, a link to an online site to view and order individual prints.

Stephanie and I sat down together one night and flipped through the proof book, writing down the number of each photograph that we would like to have in our album. The easy part was done. Next we would have to figure out the layout of each photo on a page and each page in the album.

Since the proof book is property of Timothy Whaley & Associates (until we place our order at which point it becomes ours to keep for hitting a certain dollar amount in photo sales), it’s not as simple as cutting out each photo and arranging them on a black sheet of colored paper to mimic the mat layouts, we would end up owing Timothy Whaley & Associates the cost of the album, so the software engineer part of my brain kicks in… okay, so that part is always on, but I digress…

Images I can play with

I wanted images I could manipulate. Something I could throw around, re-arrange, and swap out as I please. I spend most of my day in front of a computer, so I am just as comfortable throwing around digital images as I am with hard copies. This is where the link they gave us come into play.

I logged into our online photo collection (Wedding Photo Proofs), clicked on the first thumbnail to see the bigger version and found the URL for that image:blah/blah/blah/getImage.aspx?fileName=blahblahblah%2f0001.jpg&useProof=True

That URL taught me a few things. First, the images are stored sequentially (note the 0001.jpg). Secondly, the images are stored clean and the getImage.aspx page overlays the word ‘proof’ when displaying the image to a user (note the useProof=true).

Having been using the WWW::Mechanize class in Ruby a lot recently (for HackThisSite which I will talk about on a later day), I wrote a quick little program to download all of my proof from the web site:

require 'rubygems'
require 'mechanize'

agent = WWW::Mechanize.new
url = 'blah/blah/blah/getImage.aspx?filename=blahblahblah%2f'

for num in 1..500 do
  filename = "%04d.jpg" % num
  file = agent.get( url + filename )
  file.save_as( filename )
end

That small block of Ruby code was all I needed to download all 500 of my wedding photo proofs free of the ‘proof’ overlay.

Okay, now I have all of my wedding proofs in a digital format. What next?

Building the Album Pages

So, now I could print out all the images or load them into a photo editor to re-arrange as needed, but that doesn’t satisfy the geek in me.

I installed RMagick on my MacBook and got to work writing another Ruby application to take in a mat type and list of photographs and produce an image of what the finished product would look like. The bulk of the time I spent on the program was getting the top left coordinates of each photo for the page layout. The RMagick code that actually creates the image pretty much boils down to this:

...

dst = Magick::Image.new( 960, 1440 ) { self.background_color = 'black' }

@photos.each do |photo|
  src = Magick::Image.read( photo[:name] ).first
  src.background_color = 'transparent'
  src.crop_resized!( photo[:size].width, photo[:size].height )
  src.rotate!( photo[:rotate] ) unless photo[:rotate] == 0
  dst.composite!( src, photo[:offset].left, photo[:offset].top, Magick::OverCompositeOp )
end

...

You can download the Artist Album Page Builder (album_page.rb) Ruby program. It allows you to build 32 of the 35 mat templates (doesn’t include Half Panoramic, Panoramic, or Cover Cameo). You can build a sample of all the pages by running: ruby album_page.rb --samples

Building samples checks for two files, one called _sample_portrait.jpg and the other called _sample_landscape.jpg, if it doesn’t find those, the program creates it’s own sample images to use in generating the sample mat files.

Putting it all together

With the album_page.rb program I wrote, I was able to create as many combinations of layouts and photos as I liked.

And that is how a Software Engineer puts together a wedding album.

Example (with photos from our Honeymoon in Kauai, Hawaii):