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 5d0dc82148.
* 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:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user