Skip to content

Commit

Permalink
For non-compliant exiftool -OffsetTimeOriginal values, protect get_ex…
Browse files Browse the repository at this point in the history
…if_date_time_offset prior to callingexif_offset_to_seconds. Check if offset matches '+/-hh:mm' format. (#1697)
  • Loading branch information
oPromessa authored Nov 5, 2024
1 parent c1e3b7c commit c341a18
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions osxphotos/exifutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ def get_exif_date_time_offset(
dt = f"{matched.group(1)} 00:00:00"
default_time = True

if offset:
# make sure we have offset
if not re.match(r"([+-]\d{2}:\d{2})", offset):
offset = None

offset_seconds = exif_offset_to_seconds(offset) if offset else None

if dt:
Expand Down

0 comments on commit c341a18

Please sign in to comment.