1
0
mirror of https://github.com/eternnoir/pyTelegramBotAPI.git synced 2023-08-10 21:12:57 +03:00

Merge pull request #969 from ArtemFrantsiian/patch-1

Fix an error with the is_pil_image function
This commit is contained in:
Badiboy 2020-08-29 22:04:36 +03:00 committed by GitHub
commit d15cb16bef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,7 +11,7 @@ import queue as Queue
import logging import logging
try: try:
import PIL from PIL import Image
from io import BytesIO from io import BytesIO
pil_imported = True pil_imported = True
except: except:
@ -164,7 +164,7 @@ def is_bytes(var):
return isinstance(var, bytes) return isinstance(var, bytes)
def is_pil_image(var): def is_pil_image(var):
return pil_imported and isinstance(var, PIL.Image.Image) return pil_imported and isinstance(var, Image.Image)
def pil_image_to_file(image, extension='JPEG', quality='web_low'): def pil_image_to_file(image, extension='JPEG', quality='web_low'):
if pil_imported: if pil_imported: