On import consider GPS Location from XMP if EXIF is not available. (#912)

* 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.

* Revert "On import consider GPS Location from XMP if EXIF is not available."

This reverts commit 5d0dc821489cedf92a4e87ca6443c80ca93d4e5d.

* On import consider GPS Location from XMP if EXIF is not available.

Relevant for MOV files which do not have EXIF.
This commit is contained in:
oPromessa 2023-01-16 03:03:05 +00:00 committed by GitHub
parent 51ca4d30f3
commit 1e58e20b3c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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(