I wanted to post this ever since I came up with a fairly automated solution to add EXIF data to my film photos, but never found the moment to write about it. Now that two people have showed interest in it, I can’t hold it any more.

The short answer that everybody gives to this question is use software X to edit the EXIF, but there is more to talk about when it comes to automate the process, thus saving (a lot of) time. No matter how fancy and user-friendly the GUI is, there is always a few hundred (or thousands) photos to start with and you don’t want to spend endless hours tagging photos in small lots, you want it snapping. That is what this post is about.

Well, it all depends on how do you keep your photos organized, but in a nutshell all you need is some sort of tagging system that lets you pull the tags for any photo in an automated fashion, so that you can run a random, customizable action on every photo, depending on each photo’s tags. An example follows.

I use digiKam for organizing my photos, all the tags and other information digiKam keeps about the photos is stored in a single file. This file is a SQLite database that I can read using any software, including a simple Python script.

I wrote exif-film-tags for this purpose, along with a few other EXIF scripts for simpler, tag-independent modifications. The exif-film-tags script gets a list of photos (JPEG files) and search them in digiKam’s database, extracts the tags that matter (e.g. “Nikon FM-2n”) and runs exiv2 to insert EXIF tags in each photo. I could possibly use ExifTool instead, but I found exiv2 first.

If you use digiKam and have exiv2 installed, all you need to do is modify mapping from digiKam tags to EXIF tags in exif-film-tags is the only bit you need to reflect your own digiKam tags and how do you want them to translate into EXIF tags. Many of my EXIF tags are Nikon3, pretty useless for Canon users but I use Nikon

That is pretty much it: add tags to the photos in your favorite desktop (even possibly on-line) photo organizing software, then run a script that translates each photo’s tags into EXIF tags to write in the JPEG file and insert them.

There are innumerable possible ways to achieve this running on the same principles, so if you want more (gory) details read on to learn the bits you need to put together to build your own automated solution.

Sigue leyendo …