bigcat88/pillow_heif

issue with heic files using Pillow-SIMD but not Pillow

jzstoller opened this issue · 3 comments

Describe the bug

The script below works with pillow-10.1.0 but throws an error with Pillow-SIMD-9.0.0.post1

Steps/Code to Reproduce

from PIL import Image
from pillow_heif import register_heif_opener

register_heif_opener()

im = Image.open('testimage.heic')
im.thumbnail((200, 200))
im.save('test.jpg', 'jpeg')

Expected Results

No error is thrown using Pillow-SIMD

Actual Results

PIL.UnidentifiedImageError: cannot identify image file "/Users/testuser/testimage.heic"

Versions

3.11.5 (main, Sep  1 2023, 11:37:07) [Clang 14.0.3 (clang-1403.0.22.14.1)]
macOS-13.6.1-x86_64-i386-64bit
0.13.1
{'libheif': '1.16.2', 'HEIF': 'x265 HEVC encoder (3.4+31-6722fce1f)', 'AVIF': 'AOMedia Project AV1 Encoder 3.7.0'}

From changelog:

[0.13.0 - 2023-08-09]
- Minimum required `Pillow` version increased from `8.4.0` to `9.1.1`

Supported only Pillow's that are maximum one year old to not spend much effort on that and spend time on adding new features provided by libheif.

Thank you! I downloaded pillow_simd 9.5.0 from github and installed. Now works perfectly.

Maybe have pillow_heif throw a warning if wrong Pillow version is installed?

Maybe have pillow_heif throw a warning if wrong Pillow version is installed?

during install it is handled by pip:

pillow_heif/setup.cfg

Lines 36 to 40 in 460a1b5

python_requires = >=3.8
zip_safe = False
packages = find:
install_requires =
pillow>=9.2.0

Now works perfectly.

glad to hear it, if something else will rise, feel free to create issue/discussion :)