File tree 3 files changed +17
-14
lines changed
3 files changed +17
-14
lines changed Original file line number Diff line number Diff line change @@ -123,18 +123,21 @@ def position(self):
123
123
def utc_time (self ):
124
124
''' Get the timezone-aware datetime of the image capture '''
125
125
str_time = self .get_item ('EXIF:DateTimeOriginal' )
126
- utc_time = datetime .strptime (str_time , "%Y:%m:%d %H:%M:%S" )
127
- subsec = int (self .get_item ('EXIF:SubSecTime' ))
128
- negative = 1.0
129
- if subsec < 0 :
130
- negative = - 1.0
131
- subsec *= - 1.0
132
- subsec = float ('0.{}' .format (int (subsec )))
133
- subsec *= negative
134
- ms = subsec * 1e3
135
- utc_time += timedelta (milliseconds = ms )
136
- timezone = pytz .timezone ('UTC' )
137
- utc_time = timezone .localize (utc_time )
126
+ if str_time is not None :
127
+ utc_time = datetime .strptime (str_time , "%Y:%m:%d %H:%M:%S" )
128
+ subsec = int (self .get_item ('EXIF:SubSecTime' ))
129
+ negative = 1.0
130
+ if subsec < 0 :
131
+ negative = - 1.0
132
+ subsec *= - 1.0
133
+ subsec = float ('0.{}' .format (int (subsec )))
134
+ subsec *= negative
135
+ ms = subsec * 1e3
136
+ utc_time += timedelta (milliseconds = ms )
137
+ timezone = pytz .timezone ('UTC' )
138
+ utc_time = timezone .localize (utc_time )
139
+ else :
140
+ utc_time = None
138
141
return utc_time
139
142
140
143
def dls_pose (self ):
Original file line number Diff line number Diff line change @@ -23,6 +23,6 @@ dependencies:
23
23
- pysolar
24
24
- pyzbar
25
25
- mapboxgl
26
- - git+https://github.com/sylikc/ pyexiftool#egg=pyexiftool
26
+ - pyexiftool<=0.4.13
27
27
- jenkspy
28
28
- rawpy
Original file line number Diff line number Diff line change 29
29
'matplotlib' ,
30
30
'scikit-image' ,
31
31
'packaging' ,
32
- 'pyexiftool' ,
32
+ 'pyexiftool<=0.4.13 ' ,
33
33
'pytz' ,
34
34
'pyzbar' ,
35
35
'tqdm'
You can’t perform that action at this time.
0 commit comments