Skip to content
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

Fix incompatibility with Pillow 10.1+. #90

Merged
merged 2 commits into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ repos:
# """
##
- repo: https://github.com/PyCQA/flake8
rev: 6.1.0
rev: 7.0.0
hooks:
- id: flake8

Expand Down
4 changes: 4 additions & 0 deletions news/89.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Fix incompatibility with Pillow 10.1+.
Instead of setting ``image.mode``, we call ``image.convert``.
This works in Pillow 9 and 10.
[maurits]
2 changes: 1 addition & 1 deletion plone/scale/scale.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def scaleSingleFrame(
if extrema.get("A") == (255, 255):
# no alpha used, just change the mode, which causes the alpha band
# to be dropped on save
image.mode = "RGB"
image = image.convert("RGB")
else:
# switch to PNG, which supports alpha
format_ = "PNG"
Expand Down