I have been using Paul's script to add metadata to photos in subfolders and it is a lifesaver!
However, I need to tweak a few things for our organization. To keep it simple, I will focus on latitude and longitude here. I would like to be able to import lat/long from 2 columns in a CSV file.
First: Does the lat/long need to be in a certain format in the CSV file? Right now its simply decimal degrees (ex: 35.92, -35.92). I see that the metadata also allows for GPSLatitudeRef and GPSLongitudeRef, are these in the same columns as the lat/long (ex: 35.92N) or would there be a separate column for N,S and a separate column for E,W?
Second: I don't know much, if anything about EXIF and metadata standards in general, so correct me if I'm wrong. I found a topic on another forum that mentioned GPSLatitude and GPSLongitude and using XMPConst.NS_EXIF so using Paul's script I've added the functionality into the GUI and whatnot, but I think I'm stuck on the application towards the bottom in the if(doXXX) section.
Here is my go at it. Does this look about right?
Code: Select all
if(doLat){
try{
myXmp.deleteProperty(XMPConst.NS_EXIF, "GPSLatitude");
myXmp.setProperty(XMPConst.NS_EXIF, "GPSLatitude", Lat);
}catch(e){sendError(errorLog,decodeURI(fileName)+" :: Bad Headline : "+Lat);}
}
if(doLong){
try{
myXmp.deleteProperty(XMPConst.NS_EXIF, "GPSLongitude");
myXmp.setProperty(XMPConst.NS_EXIF, "GPSLongitude", Long);
}catch(e){sendError(errorLog,decodeURI(fileName)+" :: Bad Headline : "+Long);}
}