Remove debug prints and don't set TelegramFile.was_converted if webp image wasn't converted
This commit is contained in:
@@ -960,8 +960,6 @@ class Portal:
|
|||||||
attrs["sticker_alt"] = attr.alt
|
attrs["sticker_alt"] = attr.alt
|
||||||
elif isinstance(attr, DocumentAttributeVideo):
|
elif isinstance(attr, DocumentAttributeVideo):
|
||||||
attrs["width"], attrs["height"] = attr.w, attr.h
|
attrs["width"], attrs["height"] = attr.w, attr.h
|
||||||
print([str(attr) for attr in attributes])
|
|
||||||
print(attrs)
|
|
||||||
return attrs
|
return attrs
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|||||||
@@ -143,10 +143,11 @@ async def transfer_file_to_matrix(db, client, intent, location, thumbnail=None,
|
|||||||
|
|
||||||
image_converted = False
|
image_converted = False
|
||||||
if mime_type == "image/webp":
|
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)
|
256, 256) if is_sticker else None)
|
||||||
|
image_converted = new_mime_type != mime_type
|
||||||
|
mime_type = new_mime_type
|
||||||
thumbnail = None
|
thumbnail = None
|
||||||
image_converted = True
|
|
||||||
|
|
||||||
uploaded = await intent.upload_file(file, mime_type)
|
uploaded = await intent.upload_file(file, mime_type)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user