ianare / exif-py

Easy to use Python module to extract Exif metadata from digital image files.
BSD 3-Clause "New" or "Revised" License
831 stars 191 forks source link

Exception while handling image from Nikon camera #43

Open tokikanno opened 9 years ago

tokikanno commented 9 years ago
Traceback (most recent call last):
  File "testexif.py", line 27, in <module>
    exif = process_file(StringIO(filedata))
  File "/usr/local/lib/python2.7/site-packages/exifread/__init__.py", line 221, in process_file
    hdr.decode_maker_note()
  File "/usr/local/lib/python2.7/site-packages/exifread/classes.py", line 381, in decode_maker_note
    tag_dict=makernote.NIKON_NEW, relative=1)
  File "/usr/local/lib/python2.7/site-packages/exifread/classes.py", line 229, in dump_IFD
    printable = tag_entry[1](values)
  File "/usr/local/lib/python2.7/site-packages/exifread/tags/makernote.py", line 38, in nikon_ev_bias
    a = seq[0]
TypeError: unsupported operand type(s) for -: 'int' and 'str'

BTW, the seq array I dumped here is

seq = 'Descriptio'

dscn7397

paolobenve commented 6 years ago

still present:

File "/usr/lib/python2.7/dist-packages/exifread/__init__.py", line 216, in process_file
    hdr.decode_maker_note()
  File "/usr/lib/python2.7/dist-packages/exifread/classes.py", line 399, in decode_maker_note
    tag_dict=makernote.nikon.TAGS_NEW, relative=1)
  File "/usr/lib/python2.7/dist-packages/exifread/classes.py", line 244, in dump_ifd
    printable = tag_entry[1](values)
  File "/usr/lib/python2.7/dist-packages/exifread/tags/makernote/nikon.py", line 36, in ev_bias
    a = 256 - a
TypeError: unsupported operand type(s) for -: 'int' and 'str'

it seems that seq is not an array of integers.

The image that produced the error:

compagni preti 25 seminario 2017-06-05--07 08 42