Remove debug prints and don't set TelegramFile.was_converted if webp image wasn't converted

This commit is contained in:
Tulir Asokan
2018-04-15 20:58:41 +03:00
parent a652fb1d8c
commit 1ce8f08ff2
2 changed files with 3 additions and 4 deletions
-2
View File
@@ -960,8 +960,6 @@ class Portal:
attrs["sticker_alt"] = attr.alt
elif isinstance(attr, DocumentAttributeVideo):
attrs["width"], attrs["height"] = attr.w, attr.h
print([str(attr) for attr in attributes])
print(attrs)
return attrs
@staticmethod
+3 -2
View File
@@ -143,10 +143,11 @@ async def transfer_file_to_matrix(db, client, intent, location, thumbnail=None,
image_converted = False
if mime_type == "image/webp":
mime_type, file, width, height = _convert_webp(file, to="png", thumbnail_to=(
new_mime_type, file, width, height = _convert_webp(file, to="png", thumbnail_to=(
256, 256) if is_sticker else None)
image_converted = new_mime_type != mime_type
mime_type = new_mime_type
thumbnail = None
image_converted = True
uploaded = await intent.upload_file(file, mime_type)