Status
No public Twitter messages.
Location
Washington, DC
Subscribe to GeoRSS Subscribe to KML


Set Latitude & Longitude of photos in iView Media Pro

Published in Apple, Applescript, Open-Source, Photography, Programming  |  6 Comments


I’m making the transition to a much more stable, usable, and tool-rich photo management tool, iView Media Pro 3. I got tired of dealing with the incredibly slow interface to iPhoto thanks to Apple’s incapable handling & testing of EXIF metadata in storing to their library.

But I digress.

Behold, there was scripting

… and it was good.

I had written an Applescript to set the latitude & longitude (and other location info) to selected photos in iPhoto. iPhoto was often beligerent and required a restart of the iPhoto (and possible database recreation) to read the location information (which was viewable in the “info” panel).

iView puts the location info as a user-editable set of fields in the EXIF data fields. Users can set city, region, country, etc. But for whatever reason, they are unable to change the latitude & longitude.

I paired down my iPhoto script to just handle latitude & longitude and handle getting the file name from iView. The tough part was how to get from the iView example selected_images to a useful POSIX path to feed to exiftool. This code does the trick.


set selectedID to selected_images(1)
if selectedID = {} then
	display dialog "No photos selected"
	return
end if

repeat with this_photo in selectedID
	set photo_path to path of this_photo
	set the image_file to the POSIX path of photo_path

Installing & Using the script

iView Location Plugin - User EntryDownload the script here and expand it in your ~/Library/Application Support/iView/Plug-ins/Scripts folder and then reload iView. You will also need exiftool, as it is the real magic behind the smoke & mirrors.

To use the script, select whatever photos you want to apply the same location information to. Then go to the “Scripts” icon in the menu bar, and choose the “Set Lat/Lon” script. Enter the latitude, longitude, and altitude in decimal format, pressing “OK” after each field. Wait a little while, and then a dialog will tell you how many photos were processed.

iView Location Plugin - Post ExportBack in iView, you should see the latitude & longitude information in the right side-bar. You can also turn on lat/lon view in the thumbnail view by pressing Command-J and selecting “Latitude” “Longitude” “Altitude”. You may need to press Command-B to rebuild the thumbnail to have the info show up the first time (or on updates).

When exporting images (say to flickr!), your geo-annotated data will stay intact and can then be mapped (or mapped).

Similar Posts


Responses

  1. Greg says:

    March 12th, 2006 at 1:07 pm (#)

    It might be better if it read any existing data and put that in the window.

    Also a check to see if exiftool exists and a note if it doesn’t (if one just copied the script to another computer or whatever or they forgot to read the directions).

  2. Andrew says:

    March 13th, 2006 at 11:00 pm (#)

    Good suggestions – I’ll see about adding those.

  3. High Earth Orbit » Blog Archive » Flickr Mapping - baked in Goodness says:

    August 29th, 2006 at 6:34 am (#)

    [...] Overall it’s a very good user experience. It’s nice now that mapping is baked-right-into Flickr, which means quicker adoption rate, and easier to get going with your mapping (rather than being relegated to various mapping utilities and scripts) [...]

  4. Dane says:

    September 20th, 2007 at 4:32 pm (#)

    Hi Andrew.
    Great script. I bumped into it because I’ve been stuck trying to manipulate exif data in iView using applescript alone. It’s easy to script the manipulation of annotations data, but it seems really tricky to do so with exif data (within iView). I ran into one script that manipulates the capture date without a seperate tool like exiftool (http://downloads.iview-multimedia.com//scripts/ShiftCaptureDate.sit) but I’ve been unable to get it to work with altitude, which is the exif info I am seeking to set/edit/add.

    Anyway, I took your script and modified it to 1) read existing GPS coordinates and then fetch via the geonames web service the cooresponding altitude (via a clumsy safari gui scripting hack). I also modified the script so that it would process all selected items in the open iView catalog. I’m just learning applescript so I’d be interested in improvements. I’ll post the script in another next response to this thread.

    Dane

  5. Dane says:

    September 20th, 2007 at 5:54 pm (#)

    The modified script mentioned earlier can be downloaded from here:

    http://danespringmeyer.com/exif_altitude_from_lat_long.zip

  6. Dave14 says:

    January 2nd, 2011 at 12:55 am (#)

    But I digress.

Leave a Response