Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

push-exif --compare location consider QuickTime:GPSCoordinates for Movies #1686

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions osxphotos/cli/push_exif.py
Original file line number Diff line number Diff line change
Expand Up @@ -635,10 +635,16 @@ def compare_location(photo: PhotoInfo, file_data: dict[str, Any]) -> str:
"""Compare location between Photos and original file for a single photo"""
photo_latitude = photo.latitude
photo_longitude = photo.longitude
exif_latitude = file_data.get("EXIF:GPSLatitude")
exif_longitude = file_data.get("EXIF:GPSLongitude")
exif_latitude_ref = file_data.get("EXIF:GPSLatitudeRef")
exif_longitude_ref = file_data.get("EXIF:GPSLongitudeRef")
if photo.isphoto:
exif_latitude = file_data.get("EXIF:GPSLatitude")
exif_longitude = file_data.get("EXIF:GPSLongitude")
exif_latitude_ref = file_data.get("EXIF:GPSLatitudeRef")
exif_longitude_ref = file_data.get("EXIF:GPSLongitudeRef")
elif photo.ismovie:
exif_coordinates = file_data.get('QuickTime:GPSCoordinates')
exif_latitude, exif_longitude = [float(x) for x in exif_coordinates.split()[:2]] if exif_coordinates else [ None, None]
exif_latitude_ref = None
exif_longitude_ref = None

if exif_longitude and exif_longitude_ref == "W":
exif_longitude = -exif_longitude
Expand Down
Loading