Me: I live in Silicon Valley with my wife, child and cat. I have worked at Microsoft since I graduated from College, both in the Macintosh Business Unit on products such as Outlook Express, Entourage, IE, and Virtual PC and in Windows Live on Hotmail, Calendar and People. I am currently a Principal Lead Program Manager on the Windows Live Social Networking team. I basically manage a team of Program Managers responsible for delivering features to support our web and client applications. I've been blogging since 2001 and like to play around with .NET in my spare time working on projects such as dasBlog (the blog that powers this site) and Send to SmugMug (an application for uploading photos to SmugMug). I blog about a number of technology and productivity related topics.
Powered by: newtelligence dasBlog 2.3.9074.18820
Disclaimer The posts on this weblog are provided "AS IS" with no warranties, and confer no rights. The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
© Copyright 2010, Omar Shahine
E-mail
So, as you may recall, I'm into Geotagging my photos. Whenever I go somewhere cool, I take a long my Garmin GPS receiver, and keep a tracklog of my trip. When I return I then use the WWMX tools to download the tracks and apply the GPS coordinates to my photos. This uses the magic of matching up your GPS "breadcrumbs" with the date/time in the photos. Special care needs to be taken with timezones though.
So, things seem great... until I realize that I can only apply the Geocoding data to JPG files because the WWMX tool is a .NET Application and System.Drawing doesn't know squat about any RAW photos. To make matters worse, I now shoot with two cameras that produce two different RAW formats (NEF and Panasonic). Only one tool can open these puppies up... Photoshop and its Camera Raw Plugin.
So, I have a bunch of JPG files with GPS coordinates. But what I really want is a way to get that data into the original RAW files (for reasons that I hope are obvious). Well after some hacking with Adobe's ExtendScript Toolkit (basically a JavaScript Object Model for Bridge and other apps) I figured out how to get all the GPS data from the JPG to the RAW file (I'll post this script at some point for those that want it). Super Cool right? Wrong. It just so happens that when you convert the RAW photo back to a JPG, all the EXIF data EXCEPT the GPS data is saved. WTF? What kind of bug is that? It seems Photoshop or Adobe Camera Raw takes a lossy approach to my metadata. I just burned a few hours trying to get this precious data into the file format that is meant for preservation, archival, developing and all that stuff and now it won't make it back out to the web... dammit!
Anyway, a few posts to Adobe's forums and nuthin. However, Russell Brown gave me an idea by suggesting I download a new version of the "Image Processor" script. This is a Script that Photoshop uses to convert RAW images to JPG... and you guessed it, is written in JavaScript.
So, I cracked it open and hacked some code into line 1315. This code basically tells Adobe Bridge to go and copy the GPS info from the RAW file to the JPG.
if ( BridgeTalk.isRunning( "bridge" ) ) { var bt = new BridgeTalk(); bt.target = "bridge"; var script = "var rawThumbnail = new Thumbnail (File(\"" + inFileName + "\"));"; script += "var newPicture = new Thumbnail (File(\"" + uniqueFileName + "\"));"; script += "var rawMedadata = rawThumbnail.metadata;"; script += "newPictureMetadata = newPicture.synchronousMetadata;"; script += "rawMedadata.namespace = \"http://ns.adobe.com/exif/1.0/\";"; script += "newPictureMetadata.namespace = \"http://ns.adobe.com/exif/1.0/\";"; script += "newPictureMetadata.GPSLatitude = rawMedadata.GPSLatitude;"; script += "newPictureMetadata.GPSLongitude = rawMedadata.GPSLongitude;"; script += "newPictureMetadata.GPSAltitudeRef = rawMedadata.GPSAltitudeRef;"; script += "newPictureMetadata.GPSAltitude = rawMedadata.GPSAltitude;"; bt.body = script; bt.send(); bt.pump();}
You can find the Image Processor Script in %Program Files%\Adobe\Adobe Photoshop CS2\Presets\Scripts.
I filed a bug report with Adobe, but who knows if they will fix it...
"Thank you! Please note: You will not get a response to your bug submission. "
"Thank you!
Please note: You will not get a response to your bug submission. "
Update: I find this amazing.. as it paints a clear picture for me that whomever tested this feature at Adobe had no idea what they were doing.
When you write out GPS tags using the scripting interface above, it only updates Adobe's internal cache, the data is not ever written to the file in the case of a DNG or to the XMP sidecar file in the case of a NEF or other raw format. As a result, the GPS data is then not copied to the JPEG with my modifications to the Image Processor script.
I guess I'm off to file another bug. Ugh. In the mean time I wrote a reliable mechanism to write the GPS data from JPEG to RAW using a good old command line application. No Adobe software required. This ensures that the GPS data is in fact copied back to the JPEG when you process the RAW file in Photoshop, Bridge or Lightroom.