You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can get it work by monkeypatching the HeifImageFile._open function, changing the line:
self.mode = heif_file.mode
to
self._mode = heif_file.mode
but would be good to have a proper fix.
Steps to reproduce
importHeifImagePluginfromPILimportImage, ImageOpswithImage.open('some-heic-file.heic') asimage:
# raises exception here
Code / screenshots
File "/opt/venvs/python/lib/python3.11/site-packages/PIL/Image.py", line 3284, in open
im = _open_core(fp, filename, prefix, formats)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/venvs/python/lib/python3.11/site-packages/PIL/Image.py", line 3270, in _open_core
im = factory(fp, filename)
^^^^^^^^^^^^^^^^^^^^^
File "/opt/venvs/python/lib/python3.11/site-packages/PIL/ImageFile.py", line 117, in __init__
self._open()
File "/opt/venvs/python/lib/python3.11/site-packages/HeifImagePlugin.py", line 117, in _open
self.mode = heif_file.mode
^^^^^^^^^
AttributeError: property 'mode' of 'HeifImageFile' object has no setter
Environment
Library version: heif-image-plugin==0.6.0
Language/framework version: Python 3.11.5
OS version: CentOS 7.9
The text was updated successfully, but these errors were encountered:
Describe the bug
Does not work with Pillow 10.1. The attribute ImageFile.mode can no longer be set directly.
This is the same issue as: imageio/imageio#1044
I can get it work by monkeypatching the HeifImageFile._open function, changing the line:
self.mode = heif_file.mode
to
self._mode = heif_file.mode
but would be good to have a proper fix.
Steps to reproduce
Code / screenshots
Environment
The text was updated successfully, but these errors were encountered: