Copy link to clipboard
Copied
In LR Classic 9.1, the Map module has the wrong hemisphere (E versus W) for the GPS location. So instead of showing the location as northern California, it shows it in China.
I exported iPhone photos from the Photos app on a Mac (export unmodified original; checked Export IPTC as XMP). When I look at the file itself in Preview, it shows the following (correct) coordinates (northern California):
Latitude: 40° 26’ 32.508” N
Longitude: 123° 59’ 20.04” W
I imported the photo into Lightroom, and it shows the following GPS coordinates (China).
40°26'32.508" 123°59'20.039"
If I manually add N and W to the GPS coordinates, then it shows the correct location.
I don't know what to do to correct this before I start editing/modifying thousands of photos!
Copy link to clipboard
Copied
SOLVED (I think).
I tried several experiments. (note: The files are in the native .HEIC file format, and the names for experiments 1 and 2 were the default iPhone file names)
(1) I exporting from the Photos App again, imported into Lightroom along with the associated XMP file (which I realize has the full GPS info in much more detail than I was reporting) and replicated the problem: The Map shows the location as China, having dropped the N and W hemisphere identifiers.
(2) I imported into Lightroom, but this time I deleted the XMP file first. The GPS location is correct! It has the N and W identifiers!
(3) I ran the files (both the .HEIC and the .XMP files) through ExifRenamer to change the file names. Now the GPS location is, again, correct! (The .xmp files in approaches 1 and 3 appear to be the same, when I visually inspect them.)
I don't understand the inconsistency in reading GPS hemisphere information, but at least it works some of the time.
Copy link to clipboard
Copied
[Post mangled by forum software. See below for repost.]
Copy link to clipboard
Copied
Mac Photos is generating incorrect XMP GPS metadata that doesn't conform to industry standards. See this thread for additional details:
You could try reporting this bug to Apple, but good luck with that -- Apple's about as responsive as Adobe.
[Use the reply button under the first post to ensure replies sort properly.]
Copy link to clipboard
Copied
Thanks. What surprises me is the inconsistency of it--sometimes Lightroom gets it right, sometimes it doesn't (so sometimes it figures out Apple's non-conforming XMP). Even when it does, the Map view always has a label in the upper right that says "China" (see pic). I don't know where that comes from--I don't have any metadata presets on import.
Copy link to clipboard
Copied
"sometimes Lightroom gets it right, sometimes it doesn't"
If you want to understand why, upload two sample photos along with their .xmp sidecars (one that works with LR, one that doesn't) to Dropbox or similar and post the sharing link here. Perhaps the Photos bug is intermittent, or perhaps something else is going on.
Copy link to clipboard
Copied
I think I figured it what's going on.
I have been exporting unmodified originals with the associated XMP file that contains the GPS info (in Apple's format, not the conventions) as well as keywords. When the XMP file is there, Lightroom gets the file keywords from the Photos app but gets the GPS location wrong. In contrast, when the XMP file is NOT there, the GPS info is embedded in the exported Photos app picture, and Lightroom reads that info correctly. However, the keywords were in the XPM file, not in the photo, so without the XMP file, the keywords don't carry over.
(We can debate whose fault the GPS problems are. But the more relevant thing is that iPhones are more important to Adobe/Lightroom than Lightroom is to Apple. So Lightroom really should adjust.)
Copy link to clipboard
Copied
The bug is with Mac Photos 5.0, not the iOS camera app. Mac Photos 4.0 generates GPS coordinates in the .xmp sidecar that conform to the industry standard:
<exif:GPSLatitude>37,22.01149980N</exif:GPSLatitude>
<exif:GPSLongitude>122,15.77629980W</exif:GPSLongitude>
But Mac Photos 5.0 generates GPS coordinates that do not conform:
<exif:GPSLongitudeRef>W</exif:GPSLongitudeRef>
<exif:GPSLongitude>118.06423907887489</exif:GPSLongitude>
<exif:GPSLatitudeRef>N</exif:GPSLatitudeRef>
<exif:GPSLatitude>43.874029118876422</exif:GPSLatitude>
See here for links to the standard:
https://exiftool.org/TagNames/XMP.html#exif
You could file a feature request in the official Adobe feedback forum to change LR to accommodate the Photos 5.0 bug:
https://feedback.photoshop.com/photoshop_family/categories/photoshop_family_photoshop_lightroom
Product developers read everything posted there, but rarely participate here, which is primarily a user-to-user forum.
But in my opinion, that would be a waste of time, since I think it's highly unlikely Adobe would change LR to accommodate a simple Apple software bug in an Apple feature that's infrequently used. It might be more productive to ask Adobe to ask Apple to fix the bug (since Adobe is likely to have much more sway with Apple than a mere consumer).
[Use the reply button under the first post to ensure replies sort properly.]
Copy link to clipboard
Copied
Thanks so much--this is very helpful for a relative newbie like me. I feel like I've been wrestling with Photos and Lightroom for longer than I wanted, and a little advice goes a long way to helping me find a workflow that gets me where I am trying to go.
Copy link to clipboard
Copied
I just got bitten by this. Exported several thousand original images from Apple Photos to Lightroom Classic. Over 2,000 images showed up in China instead of the USA. Verified that the problem was the addition of the <GPSLongitudeRef>W tag and no "W" at the end of the longitude. Searched around for an easy way to fix this and found nothing.
I ended up creating a GREP based find and replace in BBedit. The search string was
^(\s+?)(<exif:GPSLongitudeRef>W</exif:GPSLongitudeRef>)\n(\s+?<exif:GPSLongitude>\d+\.\d+)(</exif:GPSLongitude>)
and the replace strings was
\3W\4
The search ensured that the xml file actually contained the bad Ref W line, removed it, and added a "W" to the longitude. One could also modify this for southern hemisphere problems. I did not fix eastern or northern hemisphere bugs since they did not cause Lightroom problems.
After checking this out on a few xml files and making sure that Lightroom corrected its map after reading the fixed metadata, I used BBedits multi file search and replace capabilities on the top level folder that contained all of my Photos files imported into Lightroom. Back in Lightroom's Map module I selected all images that appeared in China and told Lightroom to reread the metadata.
This fixed all but a handfull of images that another program and added a line between the Ref W line and the longitude line. I decided that the easiest fix for these few files was manual correction. All files in Lightroom now appear correctly in Lightroom's map module.
Copy link to clipboard
Copied
See this post elsewhere in this thread about how to use the free Exiftool utility to fix all the nonconforming .xmp files:
Copy link to clipboard
Copied
Copy link to clipboard
Copied
@dbampa: "The simplest solution is to NOT tick the'include IPTC data as XMP file’ when exporting as original. The GPS data that are imbedded in the pic file are correct."
That works well if the original included GPS coordinates. But if the user added GPS coordinates using the Photos app, the only way to get them out is by using the option Export IPTC As XMP.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
@dbampa: "if the issue is with the XMP file why not just wait and add the coordinates when the photos are imported to Lightroom?"
That doesn't apply to people who have previously tagged thousands of photos in Photos and decided to migrate to LR, such as this person:
Copy link to clipboard
Copied
Copy link to clipboard
Copied
@dbampa: "Dean Shough did not indicate he had added the GPS data from within Photos."
The post I linked to by crbnred did indicate they added locations in the Photos app:
millerrdee1 wrote, "If you export originals and turn off the export IPTC as XMP option then the coordinates flow into Lightroom correctly."
crbnred replied, "Not in case you have thousands of RAW files geotagged in Photos and want to move them to Lightroom... Then your only option is to export originals with XMP...."
Copy link to clipboard
Copied
You can use the free Exiftool utility to fix the .xmp sidecars generated by Photos 5.0. Use this command line in Terminal:
exiftool \
'-xmp-exif:gpslongitude<${xmp-exif:gpslongitude#}${xmp-exif:gpslongituderef#}' \
'-xmp-exif:gpslatitude<${xmp-exif:gpslatitude#}${xmp-exif:gpslatituderef#}' \
*.xmp
[Corrected to add the #'s, which tells Exiftool to use the raw values stored in the .xmp file.]
[Use the reply button under the first post to ensure replies sort properly.]
Copy link to clipboard
Copied
Thanks for the helpful pointer! I wanted to be able to write back to say it had all worked, but it didn't....I started trying to figure out why--which got me more confused, and slowed me down.
The short answer appears to be: When I run exiftool on the image file (.heic), it gives the correct location. When I run it on the .xmp file that Photos 5.0 produces, it already has appended an (incorrect) "E" to the gpslongitude tag. That's presumably what Lightroom is also reading.
More confusingly to me, when I look at the .xmp file in a text editor, it looks different to me from what exiftool shows, in terms of GPS location.
My challenge is that I want Lightroom to import the keywords that are embedded in the .xmp file; otherwise, I would just throw away the .xmp file. One possibility would be to figure out how to get exiftool to copy the keywords from the .xmp files directly into the .heic files. Or else, I still need to figure out how to correct what's in the .xmp files. Both of those are beyond my exiftool skills, so advice would be very much appreciated.
Two example files are here. In a text editor, the (entire) .xmp file produced by Photos 5.0 looks like this:
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="XMP Core 5.4.0">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about=""
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:exif="http://ns.adobe.com/exif/1.0/"
xmlns:photoshop="http://ns.adobe.com/photoshop/1.0/">
<dc:subject>
<rdf:Seq>
<rdf:li>Rockefeller Redwoods</rdf:li>
<rdf:li>Favorites</rdf:li>
<rdf:li>Redwoods</rdf:li>
</rdf:Seq>
</dc:subject>
<exif:GPSSpeedRef>K</exif:GPSSpeedRef>
<exif:GPSSpeed>0.023617127910090144</exif:GPSSpeed>
<exif:GPSTimeStamp>2019-12-30T22:31:15Z</exif:GPSTimeStamp>
<exif:GPSImgDirection>174.43260959</exif:GPSImgDirection>
<exif:GPSLongitudeRef>W</exif:GPSLongitudeRef>
<exif:GPSAltitudeRef>0</exif:GPSAltitudeRef>
<exif:GPSLongitude>123.94116166999997</exif:GPSLongitude>
<exif:GPSLatitude>40.341178329999991</exif:GPSLatitude>
<exif:GPSLatitudeRef>N</exif:GPSLatitudeRef>
<exif:GPSImgDirectionRef>T</exif:GPSImgDirectionRef>
<exif:GPSAltitude>51.200000000000003</exif:GPSAltitude>
<exif:GPSHPositioningError>32.004833106781454</exif:GPSHPositioningError>
<photoshop:DateCreated>2019-12-30T14:31:15-08:00</photoshop:DateCreated>
</rdf:Description>
</rdf:RDF>
</x:xmpmeta>
Most notably, neither <exif:GPSLongitude> nor <exif:GPSLatitude> have a direction (N or E/W).
In exiftool, the key fields from exiftool *.xmp show (with incorrect East):
Subject : Favorites, Redwoods
GPS Longitude : 123 deg 56' 28.18" E
GPS Latitude : 40 deg 20' 28.24" N
GPS Latitude Ref : North
GPS Longitude Ref : East
In contrast, when I run exiftool *.heic, it shows (correctly)
GPS Latitude Ref : North
GPS Longitude Ref : West
GPS Latitude : 40 deg 20' 28.24" N
GPS Longitude : 123 deg 56' 28.18" W
So in short, the .heic file is fine. The .xmp file is not.
So if possible, how do I get exiftool to add the Subject/keyword fields to the .heic file? Or else, how do I correct the GPS coordinates in the .xmp files? (I have probably 20K of them in all.) I feel like it should be easy, but it's beyond me, so any help would be appreciated. (I can also post this in a exiftool forum if that's the preferred location).
Copy link to clipboard
Copied
SOLVED. The following works for me in Mac command line (after installing exiftool) to copy the selected GPS tags from all of the .heic files into their respective .xmp files.
exiftool -tagsfromfile %d%f.heic -gpslongitude -gpslatitude -gpslongituderef -gpslatituderef -r -ext xmp /Users/lancelot/Pictures/Temp
As a newbie/ExifToolRefugee, it took me far too long to figure out how to even read the cryptic (to me) exiftool documentation, let alone decypher it and apply it to my example! But exiftool is, indeed, a powerful resource.
My thanks to johnrellis for getting me started.
Copy link to clipboard
Copied
I encountered the same problem, but using your exiftool command fixed most of the images. I had a few that produced the following error:
Warning: [minor] Tag 'xmp-exif:gpslongitude' not defined - Mexico Trip - 17.xmp
Warning: No writable tags set from Mexico Trip - 17.xmp
Warning: [minor] Tag 'xmp-exif:gpslongitude' not defined - Mexico Trip - 18.xmp
Warning: No writable tags set from Mexico Trip - 18.xmp
Warning: [minor] Tag 'xmp-exif:gpslongitude' not defined - Mexico Trip - 19.xmp
Warning: No writable tags set from Mexico Trip - 19.xmp
Warning: [minor] Tag 'xmp-exif:gpslongitude' not defined - Mexico Trip - 20.xmp
Warning: No writable tags set from Mexico Trip - 20.xmp
Warning: [minor] Tag 'xmp-exif:gpslongitude' not defined - Mexico Trip - 215.xmp
Warning: No writable tags set from Mexico Trip - 215.xmp
Warning: [minor] Tag 'xmp-exif:gpslongitude' not defined - Mexico Trip - 432.xmp
Warning: No writable tags set from Mexico Trip - 432.xmp
Warning: [minor] Tag 'xmp-exif:gpslongitude' not defined - Mexico Trip - 433.xmp
Warning: No writable tags set from Mexico Trip - 433.xmp
Warning: [minor] Tag 'xmp-exif:gpslongitude' not defined - Mexico Trip - 472.xmp
Warning: No writable tags set from Mexico Trip - 472.xmp
Warning: [minor] Tag 'xmp-exif:gpslongitude' not defined - Mexico Trip - 473.xmp
Warning: No writable tags set from Mexico Trip - 473.xmp
467 image files updated
9 image files unchanged
Any insight? Forgive me as I'm new to exiftool as well 🙂
Copy link to clipboard
Copied
Please ignore my question, it turned out that there wasn't any location data associated with the photos that produced the warning 🤷:male_sign:
Copy link to clipboard
Copied
I'm glad you got a solution. But I'm not sure why my suggested command line didn't work for you -- I tested it on the .xmp files produced by Photos 5. It takes the E/W stored in the .xmp's exif:GPSLongitudeRef and appends it to the end of the existing exif:GPSLongitude (ditto for exif:GPSLatitudeRef and exif:GPSLatitude). But your solution works too.
Exiftool does indeed have a steep learning curve. But it is by far the most authoritative tool for examining and modifying metadata. I trust it much more than any tool from Adobe, Apple, Google, etc.
[Use the reply button under the first post to ensure replies sort properly.]
Copy link to clipboard
Copied
I don't know why your command line didn't work for me either. My only conjecture is that exiftool already added an E to the end of gpslongitude when it was missing. So it wouldn't append the correct W. For example, a texteditor shows that temp.xmp file has no direction at the end, just numbers:
<exif:GPSLongitude>123.94116166999997</exif:GPSLongitude>
But when I run the following:
exiftool -xmp-exif:gpslongitude test.xmp
What I get back has added an E:
GPS Longitude : 123 deg 56' 28.18" E
In any case, you have been incredibly generous and helpful, so thank you. I am still a newby, but I've learned a little bit now about what exiftool can do:-) And I wish that Apple would fix its bug!
Copy link to clipboard
Copied
Hi johnrellis,
as I faced the same issue exporting my Photos catalog, and found your solution quite elegant. But the line you posted didn't work for me either - did not understand why.
Simple Solution is to keep a space between the '<' operator and the source/target, like:
exiftool '-xmp-exif:gpslongitude < ${xmp-exif:gpslongitude}${xmp-exif:gpslongituderef}' \
'-xmp-exif:gpslatitude < ${xmp-exif:gpslatitude}${xmp-exif:gpslatituderef}' \
*.xmp
Then it worked for me, and again many thanks for your approach.