Skip to content

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

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

Closed
salty-ivy opened this issue Sep 12, 2024 · 5 comments

Comments

@salty-ivy
Copy link
Member

salty-ivy commented Sep 12, 2024

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
Copy link
Member

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

@Stormheg
Copy link
Member

Stormheg commented Sep 13, 2024

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: python-pillow/Pillow#8333 (comment)

Let's wait and see what happens.


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

@salty-ivy
Copy link
Member Author

@Stormheg thanks!

@Stormheg
Copy link
Member

The issue is fixed in Pillow 11.0, which is not currently supported by Willow. I created #158 for that.

I suggest we keep this open until #158 is merged and released.

@zerolab
Copy link
Collaborator

zerolab commented Oct 26, 2024

https://github.com/wagtail/Willow/releases/tag/v1.9.0 is now out, so closing this

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

No branches or pull requests

3 participants