LeoHsiao1 / pyexiv2

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

Directory Canon with 7424 entries considered invalid; not read. #58

Closed mlove4u closed 3 years ago

mlove4u commented 3 years ago

My code:

# Mac bigsur, Python3.7.6
from pyexiv2 import Image

img = Image(r'IMG_9699.jpg')
img.read_exif()

Error:

Traceback (most recent call last):

  File "/Users/***/Desktop/exiv2_test/pyexiv2-master/sample.py", line 3, in <module>
    img = Image(r'IMG_9699.jpg')
  File "/Users/***/Desktop/exiv2_test/pyexiv2-master/pyexiv2/core.py", line 16, in __init__
    self.img = exiv2api.Image(filename.encode(encoding))
RuntimeError: Directory Canon with 7424 entries considered invalid; not read.

With exiv2 command line tool, it returns error and metadata. e

I am sorry I cannot attach the jpg file due to the copyright issue. Is it possible to ignore the error and get the metadata? Thank you.

LeoHsiao1 commented 3 years ago

Yes! Please try to change the log level:

pyexiv2.set_log_level(4)
mlove4u commented 3 years ago

@LeoHsiao1 Thanks. It works!

github-actions[bot] commented 2 years ago

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