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

#58 updated image deprecations for Pillow 10 #61

Closed
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
10 changes: 5 additions & 5 deletions pilkit/processors/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,11 @@ class Transpose(object):

"""
AUTO = 'auto'
FLIP_HORIZONTAL = Image.FLIP_LEFT_RIGHT
FLIP_VERTICAL = Image.FLIP_TOP_BOTTOM
ROTATE_90 = Image.ROTATE_90
ROTATE_180 = Image.ROTATE_180
ROTATE_270 = Image.ROTATE_270
FLIP_HORIZONTAL = Image.Transpose.FLIP_HORIZONTAL
FLIP_VERTICAL = Image.Transpose.FLIP_VERTICAL
ROTATE_90 = Image.Transpose.ROTATE_90
ROTATE_180 = Image.Transpose.ROTATE_180
ROTATE_270 = Image.Transpose.ROTATE_270

methods = [AUTO]
_EXIF_ORIENTATION_STEPS = {
Expand Down
2 changes: 1 addition & 1 deletion pilkit/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ def prepare_image(img, format):

alpha = img.split()[-1]
mask = Image.eval(alpha, lambda a: 255 if a <= 128 else 0)
img = img.convert('RGB').convert('P', palette=Image.ADAPTIVE,
img = img.convert('RGB').convert('P', palette=Image.Palette.ADAPTIVE,
colors=255)
img.paste(255, mask)
save_kwargs['transparency'] = 255
Expand Down