Replaced PIL's deprecated constant ANTIALIAS with LANCZOS
This commit is contained in:
parent
ddebd7a5c6
commit
3776730709
13 changed files with 16 additions and 16 deletions
|
@ -15,7 +15,7 @@ button64 = 'iVBORw0KGgoAAAANSUhEUgAAAoAAAAFACAMAAAAbEz04AAAABGdBTUEAALGPC/xhBQAA
|
|||
def image_file_to_bytes(image64, size):
|
||||
image_file = io.BytesIO(base64.b64decode(image64))
|
||||
img = Image.open(image_file)
|
||||
img.thumbnail(size, Image.ANTIALIAS)
|
||||
img.thumbnail(size, Image.LANCZOS)
|
||||
bio = io.BytesIO()
|
||||
img.save(bio, format='PNG')
|
||||
imgbytes = bio.getvalue()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue