Fix resize if needed not seeking back for image = bytes

This commit is contained in:
Lonami Exo 2019-04-02 08:59:35 +02:00
parent 85be48f42b
commit c0828f590f

View File

@ -39,7 +39,7 @@ def _resize_photo_if_needed(
or (isinstance(file, io.IOBase) and not file.seekable())): or (isinstance(file, io.IOBase) and not file.seekable())):
return file return file
before = file.tell() if isinstance(file, io.IOBase) else None before = file.tell() if isinstance(file, io.IOBase) else 0
if isinstance(file, bytes): if isinstance(file, bytes):
file = io.BytesIO(file) file = io.BytesIO(file)