File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -183,7 +183,7 @@ def update_photos_from_exif(
183
183
)
184
184
return None
185
185
186
- if dtinfo .offset_seconds :
186
+ if dtinfo .offset_seconds is not None :
187
187
# update timezone then update date/time
188
188
timezone = Timezone (dtinfo .offset_seconds )
189
189
tzupdater = PhotoTimeZoneUpdater (
Original file line number Diff line number Diff line change @@ -100,7 +100,7 @@ def get_exif_date_time_offset(
100
100
101
101
# try to get offset from EXIF:OffsetTimeOriginal
102
102
offset = exif .get ("EXIF:OffsetTimeOriginal" ) or exif .get ("OffsetTimeOriginal" )
103
- if dt and not offset :
103
+ if dt and offset is None :
104
104
# see if offset set in the dt string
105
105
for pattern in (
106
106
r"\d{4}:\d{2}:\d{2}\s\d{2}:\d{2}:\d{2}([+-]\d{2}:\d{2})" ,
@@ -130,7 +130,7 @@ def get_exif_date_time_offset(
130
130
offset_seconds = exif_offset_to_seconds (offset ) if offset else None
131
131
132
132
if dt :
133
- if offset :
133
+ if offset is not None :
134
134
# drop offset from dt string and add it back on in datetime %z format
135
135
dt = re .sub (r"[+-]\d{2}:\d{2}$" , "" , dt )
136
136
dt = re .sub (r"\.\d+$" , "" , dt )
You can’t perform that action at this time.
0 commit comments