Posts Tagged ‘exif’

Flickr, and a GPS enabled camera phone

I have always been excited about location based services. I’ve found it daft that its taken so long to get a camera integrated with a GPS chip for this amount of time, considering how cheaply available GPS chips are.

Yes, its taken a while for me to go the GPS-phone route… Nokia has had a bunch for a year-18 months already I’m sure (their Navigator phones, the N95, etc.), but for me it all came with the E71 purchase.

I like photos. Its quite natural, that I like Flickr. Its also nice to know that EXIF has so many unused fields, that you can embed location data. Flickr takes the embedded location data and then pairs it with a map. Just look at the following photo of a garden.

The garden

The meta information includes Latitude, Longitude, Altitude, as well as GPS Time/GPS Date. The Time/Date fields seem inaccurate (or non-parsed), but the Latitude, Longitude and possibly the Altitude are very correct.

Unfortunately, when I click “map”, I am disappointed. “We’re sorry, the data you have requested is unavailable. Please zoom out to see more map information or refresh your browser to try again” is the sad message I see. Yahoo! Maps doesn’t work too well… but…. Google Maps does! I enter the latitude/longitude combination, and it shows me street level accuracy. In fact, the phone’s GPS picked up the data almost as accurately as a device from Garmin did.

Flickr (and by this I mean, Yahoo!) should tear down the walled garden, and allow people to let the “map” link point to Google Maps.

How does all this work?
In Flickr, make sure you allow it to Import EXIF location data.

On the E71, I installed Nokia Location Tagger. I run this application, allow it to auto-hide, and the camera does its thing. The only way I know Location Tagger is running, is when taking a photo, has a significant lag, as the GPS data is being written. This software can start in the background – just make sure you have a fairly sensible data plan.

I upload images either via Share Online (direct to Flickr from the camera) or via transferring the images to my laptop and then uploading them. The way it gets to Flickr is immaterial – the location data is embedded in the EXIF tags.

Other thoughts
Some say this is a violation of one’s privacy. Because now, people may know where you live, and stalkers may show up. Sure.

I’ve seen examples of this on Picasa (which integrates with Google Maps, and is cool), but I haven’t used the service myself.

Searching for Creative Commons photos, by location, can be a really useful technology for stock photography. Might this disrupt the industry? Might this help, enhance the industry for someone who harnesses it?

Identifying portrait/landscape in a set of images, with ImageMagick and BASH

I haven’t written much BASH of late, so was a bit rusty. The goal? A script that would go through a directory of JPGs, find those that are portrait shots, and place them in an appropriate folder. Do so similarly for landscapes.

Use cases? Those new digital photo frames. Buy two, and have many images scroll by, eh?

What’s been done?
Making use of ImageMagick’s identify is what needs to be done. You’ll be using the -format option, which normally takes a type or string. A full list of what options are available for -format are available.

The choice is to use -format '%[exif:orientation]'. The output of identify -format '%[exif:orientation]' is either:

  • 1 – portrait
  • 6 – landscape
  • 8 – portrait (the way I normally shoot, with the battery grip)

I’ve not seen much documentation about the above, so it seems like these values come from trial and error… They apply for Canon cameras that have EXIF orientation details. I’d be interested to hear from others what values they’re getting (or getting pointed to some documentation).

The shell script?

#!/bin/sh

mkdir portrait
mkdir landscape

for i in *.jpg;
	do
	type=$(/opt/local/bin/identify -format '%[exif:orientation]' $i)
case $type in
	1)
	mv $i portrait;;
	6)
	mv $i landscape;;
	8)
	mv $i portrait;;
esac
done

Other bits of BASH?
If you do: type=$(/opt/local/bin/identify -format '%[exif:orientation]' $i) , you can grab the value from the command (1, 6, 8) and manipulate it. Check by doing echo $type.

If you’re after getting the return value from a command (i.e. 0 for success, 127 for error, and so on), you can do echo rv: $?.

All in all, remember to read the BashFAQ. Tests and Conditionals was also essential to my reading.

ImageMagick rocks nonetheless. I’ve used it before to resize, append and much more… I’m thinking that maybe its time to read The Definitive Guide to ImageMagick, written by Mikal.


i