How I add EXIF tags to film photos

Publicado por Miguel Ángel a las 00:21

Filed under: Flickr and Geekness.


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 …

How I geotag my photos

Publicado por Miguel Ángel a las 22:37

Filed under: General.


There are many posts with this title but no one like this one –this one is mine 😉

Seriously, I found valuable help in pieces of many posts regarding geotagging tools but I want to put it all together here because I know I won’t remember this all after a time. I found two approaches: the one that works beautifully every time (Linux) and the one that works beautifully when it works (Mac OS X). The latter will probably work fine for everybody else, I’m just too demanding to Mac OS X 😀

The common factor in both are the GPS device Royaltek RGM-3800, the script from Petersen Karsten (thank you!) and Flickr.

I got my GPS device for just $50 from Semsons –half its price, probably because it’s not the bleeding edge any more, who cares?– after a good reference from Petersen, who wrote the script to get the data out of it. This device doesn’t need a specific driver from its manufactor, any PL2303 USB driver will do. This driver is included in most Linux kernels and it works great, just plug it and power it on.</p

For Mac OS X you need a driver like this one. It works beautifully when it does, but when it doesn’t I end up having to reboot the laptop once or twice to get it working. In case it helps you, this is how you unload and reload the driver:

sudo kextunload /System/Library/Extensions/osx-pl2303.kext/
sudo kextload /System/Library/Extensions/osx-pl2303.kext/

The script is pretty straight forward –unless you haven’t ever used Unix-like command line– and lets you do about anything the GPS device can do: get the date from it, list all the tracks, download points in NMEA format, change the device settings (sample frecuency/interval, full-memory behavior, points format) and more stuff I don’t even know what it is for.

For geotagging photos, this is all I need: -d /dev/ttyUSB0 list to list available tracks (positions recorded while the device is running) and -d /dev/ttyUSB0 track 0 > 0.nmea to get first track’s points in NMEA format. Ideally I would reset the device before going out and ensure I have good batteries for the whole day (they last pretty close to the maximum 10 hours) so I would only need the first track #0. The -d /dev/ttyUSB0 option is only necessary in Linux.

Tracks in NMEA format are not accepted by photo geotagging software so they have to be translated to the GPX format. This is necessary for most photo geotagging software but gpsbabel translates GPS data across many formats.

Using the command line, just run gpsbabel -i nmea -o gpx 0.nmea 0.gpx to get data in GPX format. KML format (gpsbabel -i nmea -o kml 0.nmea 0.kml) can come in handy to preview the tracks in Google Earth to have an idea of how accurate the tracks are. There are some GUIs for the allergic to command line 😉

Once you get GPS data in GPX format you can use any photo geotagging software you like, I just tried GPSPhotoLinker for Mac OS X but still prefer gpscorrelate on Linux –should be able to compile in Mac OS X but there is no binary. I just love command line and hate dragging photos all over the place. I hate iPhoto too.

Yet before running any of these cool tools there is an important thing to find out: the time difference between the photos and GPS data. The latter is in UTC time zone but photos are usually not –not even in places in GMT/BST time zones!

Assuming a time difference of -2 hours (photos are 2 hours behind UTC) I would run gpscorrelate -g 0.gpx -z -2 *.jpg to get EXIF GPS tags added to the photos. Most of them will have interpolated (time weighted) positions but I find it failry accurate in general having set the GPS device to log position every 5 seconds.

When it comes to upload the photos to the cloud most photo share websites already take GPS EXIF tags in consideration. Panoramio and Picasa web place photos in Google Maps, it just works. However, if you use Flickr there is an option you need to modify in Privacy & Permissions on your account to get the photos automatically added to the map, this is disabled by default for the sake of geoprivacy: Import EXIF location data. You may also want to tune Who will be able to see your stuff on a map.

And then you can share maps like this one 🙂

Safety First!

Publicado por Miguel Ángel a las 22:25

Filed under: Life and Photography.


I admit I take some risks not many are willing to take, but I love the results…

Nikon D80However, I do be careful and try to get my equipment ready, always wear the camera strap on my neck and a UV or Skylight filter in all my lenses –only took it out for the photo. Thanks that 62mm UV filter I still have my lovely Nikkor 85mm f/1.8 in good condition. Now the filter is just a hood:

  • Broken filter
  • Thanksfully its a €12 filter, not a €450 lens 🙂

    A change in my Flickr life

    Publicado por Miguel Ángel a las 14:09

    Filed under: Flickr and Life.


    Up to two months ago I was posting in Flickr a mix of good and not-so-good photos but didn’t want to post in Flickr all my photos, I had my own photo gallery for the bulk of them. However, that changed and now I have two Flickr photostreams: my main photostream for the photos I like most and my other photostream for the bulk of them all, where you might find photos you like more than me! — and this has happened already.

    From now on, I will mostly follow a predictable flow of publication: whenever I get a photo I really like –or go to a place and want to link you to the bulk of photos I took there, even if no one are really good– I will post one or two photos in my main photostream, which will link to the bulk set of photos. Photos from friends and family will go to my other photostream –with appropriate access control– and only if I get a really good one –and permission to publish it– will I post it in my main photostream for the joy of everyone.

    That said, you may want to visit or watch my other photostream to check for new photos even if there is no change in my main photostream. I will be happy with people adding me (private-miguev) as contact, but will rarely add people as contact from that account and very few will be marked as friend in that account. If you want to (social) network with me, please use my main (miguev) account.

    There is yet something I’m not completely happy with about Flickr: their maps. Being used to Google Maps I find myself quite disappointed when I see how old Flickr maps are, quite inappropriate for accurately placing photos. This is why I am also using Panoramio, which lets me place photos very accurately and they may even get selected to be displayed in Google Earth. And you can always have a look at the map of all my photos in Panoramio.

    The perfect moment

    Publicado por Miguel Ángel a las 10:08

    Filed under: Life and Photography.


    I wanted to wait until the end of this year, but in my last visit to Tenerife, my father scared me with this:

    Nikon has stopped manufacturing the D80 and Maya knows about it, that’s why they are selling it so cheap. The D200 price dropped €200 a couple of days before the D300 was announced. Now the next DSLR must be about to be announced.

    He told me that on June 26th and the new Nikon D700 was announced on July 1st, so he was right! Knowing how damn good he is for this kind of thing, I ran to Maya (Nikon’s representative in Tenerife) just before taking my flight back to Ireland but they didn’t have any D80 body left, all sold out! Luckily they had a kit without lenses and I could take its body, only because we have been regular customers for about 30 years 🙂

    • Nikon D80

    After having this camera (well, my father’s) for a couple of weeks (see some photos) I learned many things and took a few decisions. I already told you about one but that was only to be expected, probably everyone was just waiting for me to realize. The one no one would expect is that I intend to use my DSLR nearly as a film camera, but that will be another post… some day 😉