Flickr, EXIF, Machine Tags – by Paul Mison (@blech)

I actually compiled my answers a couple of weeks before it was posted, hence the reference to groupr as a “lost project”. Now, of course, it’s back, but I’ve already posted a couple of times about that. What I would like to do is – finally, and belatedly – document (and update the released version of) my EXIF machine tagger.

Why bother with such a thing? Flickr will extract EXIF metadata, but it won’t allow you to do any aggregate queries on it. (Well, that’s not quite true; at dConstruct 2007 Tom Coates leaked some URLs which I picked over, but they don’t cover all the useful things I’d like. Plus, it’s not documented.) By extracting all the data from my photos into machine tags (and a local SQLite database), it becomes possible to point people at all the photos taken at the wide end of my widest lens, or those taken with a particular make of camera (and to do more complex queries locally).

With that out of the way, how do you go about such a thing? Well, as usual, it’s actually a fairly simple joining operation. Get a list of photos, and for each of them, get the EXIF data (using flickr.photos.getExif), then store the data locally, and add tags back to Flickr. There’s not much munging invovled – I convert spaces in the EXIF field names to underscores, and some things get put in the “file:” or “camera:” namespace, rather than “exif:” – so it’s all pretty straightforward. (I do preserve spaces in the EXIF values, though, by quoting my arguments to the addTags method.)

This is great, I’m surprised I missed it previously.

For whatever bizarre reason, Flickr lets you search & tag your photos by all kinds of criteria except the EXIF inside the photos themselves. The EXIF data includes all the properties of the photo — the camera make & model, the focal length, the aperture & shutter settings, whether or not a flash was used, etc.

So if you want to search by a certain property — say, all the pictures taken with a certain camera, or at a certain focal length or aperture, tough noogies, you can’t do it through Flickr.

Except now, with Paul’s script, you finally can.

This is such an obviously good & useful idea to have in a photo sharing site that I’ve long wondered why Flickr didn’t do something like this for you automatically.

I still wonder why, but now, I don’t have to worry about it.

Thanks, Paul! :-)

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s