wagtail / Willow

A wrapper that combines the functionality of multiple Python image libraries into one API
https://willow.wagtail.org/
BSD 3-Clause "New" or "Revised" License
274 stars 53 forks source link

ValueError Image has wrong mode when accessing renditions of this particular image. #154

Open salty-ivy opened 1 month ago

salty-ivy commented 1 month ago

Description

On a successful upload of this image, it bypasses the image rendition generation.

and on web when trying to access this via CMS admin we get a ValueError and image has wrong mode down from willow/pillow as wagtail tries to regenerate the renditions if not found.

Screenshot 2024-09-12 at 10 32 26 PM

after deleting the wagtail.images.Image instance and corresponding renditions it seems to work.

the Image

tony_bern

Ideas and thoughts

Whole page /admin/images/ becomes inaccessible which is a big issues cause there's no warning at the time of upload.

May be wagtail/willow should throw some error/warning or reject the upload if renditions don't get generated on upload?

Stormheg commented 1 month ago

I tried uploading this file and can confirm I'm seeing the same error (Willow==1.8.0 and wagtail==6.2.1)

Stormheg commented 1 month ago

I've investigated and this is an issue upstream in Pillow 10.3.0. There is an issue open about it already and I've commented on it with my findings here: https://github.com/python-pillow/Pillow/issues/8333#issuecomment-2349279247

Let's wait and see what happens.


As a workaround you can install Pillow==10.2.0 in the mean time.

salty-ivy commented 1 month ago

@Stormheg thanks!