Parsing an exif containing jpeg, captured with an exposure time of 1.6 seconds causes an exception (python 2.4, SuSE 10.0 linux 32bit): ...
Traceback (most recent call last):
File "../bin/exiftool", line 297, in ?
tags = exif.parse(path_name, verbose_opt, mode_opt)
File "/usr/lib/python2.4/site-packages/exif.py", line 660, in parse
value_map = parse_tiff(tiff, mode)
File "/usr/lib/python2.4/site-packages/exif.py", line 571, in parse_tiff
offset = parse_ifd(tiff, mode, offset, value_map)
File "/usr/lib/python2.4/site-packages/exif.py", line 561, in parse_ifd
parse_tag(tiff, mode, value_map, TAG_MAP)
File "/usr/lib/python2.4/site-packages/exif.py", line 543, in parse_tag
val = tag.format.str_table(value_table, value_map)
File "/usr/lib/python2.4/site-packages/exif.py", line 226, in str_table
for val in table: result.append(self.str_value(val))
File "/usr/lib/python2.4/site-packages/exif.py", line 270, in str_value
return format_time(pow(0.5, val[0]/float(val[1])))
File "/usr/lib/python2.4/site-packages/exif.py", line 260, in format_time
return "1/%d" % int(1/t+0.5)
ZeroDivisionError: float division
In python 2.4 (not checked in other versions), at line 270 val=(4294967236L, 100)
Could be because python is treating values of this magnitude as unsigned. Either wa, I don't understand the exif format, but inserting this before line 270, to correct values > 0x7fffffff to be negative numbers seems to sort it:
if val[0] & 0x80000000L:
val= val[0]-0x100000000L, val[1]