FlickrExifTagger

This is a simple and hacky script that I use to add machine tags to my Flickr images describing the lens used for a photo. Machine tags are one way to add meta information to Flickr images in a somewhat more sorted way that the usual tags using namespaces and a key-value system. The Flickr FAQ give a short introduction on machine tags. Using machine tags to describe the lens used for a photo normally duplicates the information already existing in the exif tags of the photo (if the camera adds these information) but allows searching for lenses as searching for exif information is not yet very well usable using the Flickr API. Moreover, most cameras add the lens type in a maker or even camera specific form to the exif tags. which complicates a unified search over all camera brands.

FlickrExifTagger is a really simple script written in Ruby that uses flickraw to access the Flickr API. It iterates over all photos of the user’s account, starting with the mos recent photo, reads the exif information and uses a hard-coded set of rules to add lens machine tags.

This script is really not intended to be used without modifications in the code!

Customizing the Rules

The script contains only rules for my camera that certainly need to be adapted to suit your needs. There is a comment in the source code indicating the place of the rule set. My Olympus E-510 adds a lens signature in the makernotes. Other cameras may not do this. In that case you could use the focal length etc.

Usage

After having modified the rules you can launch the script using ruby flickrExifTagger.rb. It will connect to the Flickr API and generate a link that you have to visit in order to grant the permissions to the script. If this was done, the script runs through all of your photos until there are no more photos in your stream or it is interrupted using ctrl + c.

Getting the Code

The source code is available in my svn:

https://ssl.semipol.de/svn/projects/FlickrExifTagger/

Login with user name anonymous and password anonymous.

License

The source code is released under the terms of the GNU General Public License (GPL), version 2.