From 5d0dc821489cedf92a4e87ca6443c80ca93d4e5d Mon Sep 17 00:00:00 2001 From: MSP Date: Fri, 13 Jan 2023 00:57:57 +0000 Subject: [PATCH] On import consider GPS Location from XMP if EXIF is not available. On import consider GPS Location from XMP if EXIF is not available. Relevant for MOV file types without EXIF. --- osxphotos/cli/import_cli.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/osxphotos/cli/import_cli.py b/osxphotos/cli/import_cli.py index 74ff199b..49fcfd93 100644 --- a/osxphotos/cli/import_cli.py +++ b/osxphotos/cli/import_cli.py @@ -319,6 +319,8 @@ def location_from_file( latitude = -latitude elif latitude_ref != "N": latitude = None + if latitude is None: + latitude := metadata.get("XMP:GPSLatitude"): if longitude := metadata.get("EXIF:GPSLongitude"): longitude = float(longitude) longitude_ref = metadata.get("EXIF:GPSLongitudeRef") @@ -326,6 +328,8 @@ def location_from_file( longitude = -longitude elif longitude_ref != "E": longitude = None + if longitude is None: + longitude := metadata.get("XMP:GPSLongitude"): if latitude is None or longitude is None: # maybe it's a video if lat_lon := metadata.get("QuickTime:GPSCoordinates") or metadata.get(