uploadcare / pillow-simd

The friendly PIL fork
https://python-pillow.github.io/pillow-perf/
Other
2.12k stars 85 forks source link

issue with heic files using Pillow-SIMD but not Pillow #133

Closed jzstoller closed 7 months ago

jzstoller commented 7 months ago

What did you do?

Compare conversion of an heic file to jpg using either Pillow or Pillow-SIMD

What did you expect to happen?

Conversion will execute with Pillow and Pillow-SIMD

What actually happened?

This error message occured with Pillow-SIMD but executes perfectly with Pillow: PIL.UnidentifiedImageError: cannot identify image file "/Users/testuser/testimage.heic"

What are your OS, Python and Pillow versions?

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')
jzstoller commented 7 months ago

Hi,

Would you mind commenting if there is an answer to this issue? Was my description not detailed enough?

thank you

homm commented 7 months ago

https://github.com/uploadcare/pillow-simd#contributing-to-pillow-simd

jzstoller commented 7 months ago

Thank you for the quick reply. I believe this is an SIMD bug...not a general Pillow bug. The script works fine when pillow-10.1.0 is installed but does not work when Pillow-SIMD-9.0.0.post1 is installed.

jzstoller commented 7 months ago

For those who have this same issue. The Pillow-SIMD version (9.0.0.post1) on pypi.org is not up to date and therefore does not work with pillow_heif. Pillow version >=9.1.1 is required for pillow_heif (since 0.13.0).

see here From pillow_heif changelog: [0.13.0 - 2023-08-09]

To solve the problem, download pillow_simd 9.5.0 from github and install:

pip install '/Users/username/Downloads/pillow-simd-9.5.0.zip'