Open bttmchnd opened 4 years ago
Getting a similar behavior with a pdf file
[2020-10-13 12:00:36,051] [ERROR@mau.as] Exception in Matrix event handler
Traceback (most recent call last):
File "/opt/mautrix-telegram/lib/python3.8/site-packages/mautrix/appservice/as_handler.py", line 157, in try_handle
await handler_func(event)
File "/opt/mautrix-telegram/lib/python3.8/site-packages/mautrix/bridge/matrix.py", line 417, in int_handle_event
await self.handle_message(evt.room_id, evt.sender, evt.content, evt.event_id)
File "/opt/mautrix-telegram/lib/python3.8/site-packages/mautrix/bridge/matrix.py", line 278, in handle_message
await portal.handle_matrix_message(sender, message, event_id)
File "/opt/mautrix-telegram/mautrix_telegram/portal/matrix.py", line 369, in handle_matrix_message
await self._handle_matrix_message(sender, content, event_id)
File "/opt/mautrix-telegram/mautrix_telegram/portal/matrix.py", line 416, in _handle_matrix_message
await self._handle_matrix_file(sender_id, event_id, space, client, content, reply_to,
File "/opt/mautrix-telegram/mautrix_telegram/portal/matrix.py", line 255, in _handle_matrix_file
w, h = content.info.width, content.info.height
AttributeError: 'FileInfo' object has no attribute 'width'
on latest master branch
@a000a that's a completely unrelated problem, fixed in fdc58ce450f3768bc9cbef4d62fde130dde8ef05
So the problem here is that the parallel transfer option only works if the media repo includes a Content-Length
header. I think matrix-media-repo doesn't include it in some cases, Synapse probably always does. A temporary fix is to disable parallel transfers in the config. The proper solution is to automatically fall back to normal file transfer when there's no content length header.
Seems to be breaking stickers (Matrix -> Telegram), too:
First one was sent with parallel_file_transfer: true
, second with parallel_file_transfer: false
.
That's expected, the bridge can't convert images to webp without having the whole thing in memory. If the stickers are in the correct format already on Matrix, then they should work on Telegram too.
All the default dimension stickers use PNG, and it even converts the stickers imported from Telegram to PNG.
Will you accept a PR that ignores parallel_file_transfer
setting for stickers?
But they work from Telegram to Matrix.
Version: latest Docker image.