ianare / exif-py

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

fix struct.error if buf less than 2 #158

Closed UngeheurenUngeziefer closed 2 years ago

UngeheurenUngeziefer commented 2 years ago

Function exifread.process_file(image) didnt work for some images with corrupted exif info. To put it to work I set an extra check: if buf variable exist we need to check that length of buf more than 1. Because if buf equals 1 function gives error "struct.error: unpack requires a buffer of 2 bytes" and function stop iterating to next files.