LeoHsiao1 / pyexiv2

Read and write image metadata, including EXIF, IPTC, XMP, ICC Profile.
GNU General Public License v3.0
201 stars 39 forks source link

If exiv2 throws an exception, even if it has been caught, the program will still crash. #1

Closed LeoHsiao1 closed 5 years ago

LeoHsiao1 commented 5 years ago

Open an image without iptc data as follows:

>>> from py_exiv2 import image
>>> i = image(r"C:\Users\Leo\Desktop\1.jpg")
>>> i.read_iptc()
RuntimeError: (Caught Exiv2 exception) No IPTC data found in the file.
>>> 
>>>          # It looks normal now
>>> 
>>> i.read_exif()
# crashed
LeoHsiao1 commented 5 years ago

fixed it in commit e02f48b Now, it will return an empty dictionary when there is no data, instead of throwing an exception.

github-actions[bot] commented 3 years ago

This issue has been automatically closed because there has been no activity for a month.