hMatoba / Piexif

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

Returns from _ExifReader.get_ifd_dict() a special result with error description instead of raising exception. #99

Closed Cykooz closed 4 years ago

Cykooz commented 4 years ago

Fixed exception (struct.error) in '_ExifReader.get_ifd_dict()' method during parse of EXIF with invalid IFD pointers. Instead, the method returns dictionary with '_errors' key that has description of error.

coveralls commented 4 years ago

Coverage Status

Coverage increased (+0.01%) to 94.896% when pulling 0fb0923c5be74b2a5e10d0ddbecc31f0f3436c42 on Cykooz:master into 3422fbe7a12c3ebcc90532d8e1f4e3be32ece80c on hMatoba:master.

hMatoba commented 4 years ago

Thanks!

I want to add your way(continue without exception) as option. load(filename, force_load=True) Could you add option like above?

Cykooz commented 4 years ago

I have found images with other types of errors in EXIF. Such as:

I am going to rewrite this Pull-request and add a new safe_load() function that will return a tuple with a EXIF-dictionary and a list of errors.