Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blank tile with filename alt instead of picture if dynamic thumbnails disabled on HS #1110

Open
bkil opened this issue May 30, 2023 · 0 comments

Comments

@bkil
Copy link

bkil commented May 30, 2023

If you are sent an image that has no thumbnail attached and if the client would want to generate one dynamically and your HS has generating dynamic thumbnails disabled (such as on matrix.org), you will get a HTTP 400 with the following body instead of the image:

{"errcode":"M_UNKNOWN","error":"Cannot find any thumbnails for the requested media ([b'oregpreshaz.eu', b'GbhXUxEGpzNdxKlRwYYTUObT']). This might mean the media is not a supported_media_format=(image/jpeg, image/jpg, image/webp, image/gif, image/png) or that thumbnailing failed for some other reason. (Dynamic thumbnails are disabled on this server.)"}

From a Hydrogen perspective, I think it would be worthwhile to

  • Signal any and all errors to the user in some way other than the broken file icon
  • In this special case, provide some other means to access the image, either render the full size image without a smaller thumbnail or after clicking on it or offering a download link, whose URL in this case would be:

https://matrix-client.matrix.org/_matrix/media/r0/download/oregpreshaz.eu/GbhXUxEGpzNdxKlRwYYTUObT

Example faulty rendering:

Event JSON:

{
  "content": {
    "body": "1.jpg",
    "info": {
      "h": 609,
      "mimetype": "image/jpeg",
      "size": 39748,
      "w": 500,
      "xyz.amorgan.blurhash": "TENwV+-q~XxoWCWBRn-rt5M}xtt6"
    },
    "msgtype": "m.image",
    "url": "mxc://oregpreshaz.eu/GbhXUxEGpzNdxKlRwYYTUObT"
  },
  "origin_server_ts": 1680515876737,
  "room_id": "!CwMDVzZXiVUzvlBHdn:grin.hu",
  "sender": "@dani:oregpreshaz.eu",
  "type": "m.room.message",
  "unsigned": {},
  "event_id": "$cE4cZAY58PHudxyXdqR5dk648_HsBfDoGmazkjVSYuM",
  "user_id": "@dani:oregpreshaz.eu"
}

Screenshot:

archive matrix org_issues_253_picture_not_showing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant