matrix-org/pantalaimon

Thumbnails are not generated when HTML message bodies are sent containing an content image link

TheSpookyElectric opened this issue · 1 comments

Describe the bug
With version 0.8.0 this works as expected

In version 0.9.0 and up, when you send a room message (encrypted or not) containing HTML with an img link such as:

Hello, <img src="mxc://matrix.example.com/SmDLwfwZHhIyaZuqmthPvHGb">

Then no thumbnail will be generated.

And to verify, hitting the full link:

https://matrix.example.com/_matrix/media/r0/thumbnail/matrix.example.com/SmDLwfwZHhIyaZuqmthPvHGb?width=200&height=600&method=scale
Will result in an error stating:

{"errcode":"M_UNKNOWN","error":"Failed to generate thumbnail."}

To Reproduce
Steps to reproduce the behavior:

  1. Upload an image to your host via the endpoint _matrix/media/r0/upload and take note of it's content ID
  2. Use any client that can create HTML (org.matrix.custom.html) messages and create a message containing an img with source referencing the mcx:// URI
  3. Send the message to a room (encrypted or unencrypted)
  4. See missing thumbnail

Expected behavior
Thumbnail is generated

Screenshots
Version 0.10.2 (happens with 0.9.0+)
image

Version 0..8.0
image

Desktop (please complete the following information):

  • OS: Ubuntu 20.04
  • Browser: Chrome
  • Version 0.10.2
  • Synapse Version: 1.37 and up

Additional context
Although 0.8.0 works and 0.9.0+ does not, I'm still not 100% certain that pantalaimon is fully to blame. I'm not very familiar its handling of thumbnails. Though I did see the other issue #90 it is not the same. The difference being HTML I think.

Seems to be fixed by using /v3/upload instead of /r0/upload