Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exifread.heic.NoParser: hdlr #184

Open
honzajavorek opened this issue Aug 6, 2023 · 1 comment
Open

exifread.heic.NoParser: hdlr #184

honzajavorek opened this issue Aug 6, 2023 · 1 comment

Comments

@honzajavorek
Copy link

Using version 3 of exif-py, it crashes when trying to parse a .HEIC photo from an iPhone, e.g. the one I'm attaching zipped here: IMG_4733.HEIC.zip

/Users/honza/Downloads/cindy_test/IMG_5394.HEIC
Traceback (most recent call last):
  File "/Users/honza/Library/Caches/pypoetry/virtualenvs/cindy-WgoVcAt6-py3.11/lib/python3.11/site-packages/exifread/heic.py", line 171, in get_parser
    return defs[box.name]
           ~~~~^^^^^^^^^^
KeyError: 'hdlr'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Users/honza/Library/Caches/pypoetry/virtualenvs/cindy-WgoVcAt6-py3.11/lib/python3.11/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/honza/Library/Caches/pypoetry/virtualenvs/cindy-WgoVcAt6-py3.11/lib/python3.11/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/Users/honza/Library/Caches/pypoetry/virtualenvs/cindy-WgoVcAt6-py3.11/lib/python3.11/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/honza/Library/Caches/pypoetry/virtualenvs/cindy-WgoVcAt6-py3.11/lib/python3.11/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/honza/Projects/cindy/cindy/__main__.py", line 22, in main
    tags = exifread.process_file(f)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/honza/Library/Caches/pypoetry/virtualenvs/cindy-WgoVcAt6-py3.11/lib/python3.11/site-packages/exifread/__init__.py", line 137, in process_file
    offset, endian, fake_exif = _determine_type(fh)
                                ^^^^^^^^^^^^^^^^^^^
  File "/Users/honza/Library/Caches/pypoetry/virtualenvs/cindy-WgoVcAt6-py3.11/lib/python3.11/site-packages/exifread/__init__.py", line 109, in _determine_type
    offset, endian = heic.find_exif()
                     ^^^^^^^^^^^^^^^^
  File "/Users/honza/Library/Caches/pypoetry/virtualenvs/cindy-WgoVcAt6-py3.11/lib/python3.11/site-packages/exifread/heic.py", line 268, in find_exif
    meta = self.expect_parse('meta')
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/honza/Library/Caches/pypoetry/virtualenvs/cindy-WgoVcAt6-py3.11/lib/python3.11/site-packages/exifread/heic.py", line 159, in expect_parse
    return self.parse_box(box)
           ^^^^^^^^^^^^^^^^^^^
  File "/Users/honza/Library/Caches/pypoetry/virtualenvs/cindy-WgoVcAt6-py3.11/lib/python3.11/site-packages/exifread/heic.py", line 177, in parse_box
    probe(box)
  File "/Users/honza/Library/Caches/pypoetry/virtualenvs/cindy-WgoVcAt6-py3.11/lib/python3.11/site-packages/exifread/heic.py", line 195, in _parse_meta
    psub = self.get_parser(box)
           ^^^^^^^^^^^^^^^^^^^^
  File "/Users/honza/Library/Caches/pypoetry/virtualenvs/cindy-WgoVcAt6-py3.11/lib/python3.11/site-packages/exifread/heic.py", line 173, in get_parser
    raise NoParser(box.name) from err
exifread.heic.NoParser: hdlr
@heckler
Copy link

heckler commented Dec 14, 2023

Since this is still an issue as of v 3.0.0, for anyone facing this issue, downgrading to the latest 2.x release solved it for me:

python -m pip install "exifread<3"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants