Merge pull request #6539 from PySimpleGUI/Dev-latest

Replaced PIL's deprecated constant ANTIALIAS with LANCZOS
This commit is contained in:
PySimpleGUI 2023-10-05 16:12:38 -04:00 committed by GitHub
commit 03ed1948e2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 16 additions and 16 deletions

View file

@ -2664,7 +2664,7 @@ def convert_to_bytes(file_or_bytes, resize=None):
if resize:
new_width, new_height = resize
scale = min(new_height/cur_height, new_width/cur_width)
img = img.resize((int(cur_width*scale), int(cur_height*scale)), PIL.Image.ANTIALIAS)
img = img.resize((int(cur_width*scale), int(cur_height*scale)), PIL. Image.LANCZOS)
bio = io.BytesIO()
img.save(bio, format="PNG")
del img
@ -2747,7 +2747,7 @@ def convert_to_bytes(file_or_bytes, resize=None):
if resize:
new_width, new_height = resize
scale = min(new_height/cur_height, new_width/cur_width)
img = img.resize((int(cur_width*scale), int(cur_height*scale)), PIL.Image.ANTIALIAS)
img = img.resize((int(cur_width*scale), int(cur_height*scale)), PIL. Image.LANCZOS)
bio = io.BytesIO()
img.save(bio, format="PNG")
del img