mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-07-13 01:22:21 +03:00
Use lanczos for compression and always compress
This commit is contained in:
parent
9cf4cd70d1
commit
4e305c9e17
|
@ -58,10 +58,7 @@ def _resize_photo_if_needed(
|
||||||
except KeyError:
|
except KeyError:
|
||||||
kwargs = {}
|
kwargs = {}
|
||||||
|
|
||||||
if image.width <= width and image.height <= height:
|
image.thumbnail((width, height), PIL.Image.LANCZOS)
|
||||||
return file
|
|
||||||
|
|
||||||
image.thumbnail((width, height), PIL.Image.ANTIALIAS)
|
|
||||||
|
|
||||||
alpha_index = image.mode.find('A')
|
alpha_index = image.mode.find('A')
|
||||||
if alpha_index == -1:
|
if alpha_index == -1:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user