hMatoba / Piexif

Exif manipulation with pure python script.
MIT License
367 stars 81 forks source link

Failure to decode a minimal 1 x 1 pixel JPEG #92

Closed toaarnio closed 5 years ago

toaarnio commented 5 years ago

Piexif fails with a struct.error when trying to decode this 1x1-pixel JPEG: http://i.imgur.com/M0IqkRT.jpg:

File "<path redacted>/piexif/_common.py", line 42, in read_exif_from_file
    length = struct.unpack(">H", head[2: 4])[0]
struct.error: unpack requires a buffer of 2 bytes