00:06
<Andreu Botella (he/they)>
SVG only shows up in some cases. PNG works everywhere.
Huh, apparently the matrix.org homeserver is buggy when making thumbnails for SVG images, but the mozilla.org homeserver isn't
06:36
<annevk>
Domenic: you should be able to navigate a nested context to a data: URL (there's an open PR by me on forbidding it for top-level contexts with some open questions)
06:37
<annevk>
(I changed the avatar to a PNG)
07:01
<DerekNonGeneric>
wfm
07:02
<DerekNonGeneric>
fwf, i know for a fact svgs work since that is what i used for my own room
07:03
<DerekNonGeneric>
no clue if there are attributes missing on y'alls (perhaps a case of over-optimization)
07:06
<Andreu Botella (he/they)>
The issue is https://github.com/matrix-org/synapse/issues/1309
07:06
<Andreu Botella (he/they)>
I don't know why it works on mozilla.org though, since it also seems to use Synapse
07:11
<DerekNonGeneric>
tbh, not entirely sure how important it is to have a non-lossy image format at this point
07:13
<DerekNonGeneric>
guess the room preview @ https://matrix.to/#/#whatwg:matrix.org will remain relatively small
07:14
<DerekNonGeneric>
oh, but when you click on the room image in the element web app it takes up the entire screen
07:15
<DerekNonGeneric>
oof, that is less than ideal
07:25
<MayeulC>
Rooms exist on all participating servers at the same time; media such as images is also duplicated. You can replace matrix-client.matrix.org by any other participating homeserver and still get the media. For instance, here is the room logo on my server, KDE's, Mozilla's.
07:27
<MayeulC>
And your client fetches the media from your own homeserver (which will fetch it from the federation if not available; currently synapse only asks the originating homeserver).
08:16
<DerekNonGeneric>
I don't know why it works on mozilla.org though, since it also seems to use Synapse
Andreu Botella (he/they): can you give me an example of it working on mozilla.org? do you mean chat.mozilla.org?
08:21
<Andreu Botella (he/they)>
Right now the logo is a PNG, but If you have your user account registered on the mozilla.org homeserver, you could see the logo before
08:26
<DerekNonGeneric>
Right now the logo is a PNG, but If you have your user account registered on the mozilla.org homeserver, you could see the logo before
my user acc is on mozilla.org and i was not able to see the logo previously as it was an svg
08:30
<Andreu Botella (he/they)>
I don't know, but when I was testing this last night, downloading the logo with the download API worked on both my usual mozilla.org account and on a test matrix.org account, but the thumbnail API gave a 404 on the matrix.org account
08:30
<Andreu Botella (he/they)>
https://matrix.org/docs/spec/client_server/r0.6.1#get-matrix-media-r0-download-servername-mediaid
08:31
<DerekNonGeneric>
none of the rooms in the mozilla.org homeserver seem to be using an svg afaict
08:34
<DerekNonGeneric>
[...] but the thumbnail API gave a 404 on the matrix.org account
08:34
<DerekNonGeneric>
ditto here
13:04
<freddy>
i saw the logo before the change and still see it now. Fwiw we use #synchronicity:mozilla.org for debugging and discussing these types of issues. at least it's the "mozilla gateway to the matrix devs".. :) not sure if that helps
18:35
<DerekNonGeneric>
i saw the logo before the change and still see it now. Fwiw we use #synchronicity:mozilla.org for debugging and discussing these types of issues. at least it's the "mozilla gateway to the matrix devs".. :) not sure if that helps

freddy: thanks, good to know (guess id ask in there before making any future support request). to be clear tho, afaict the issue might not be exclusive to mozilla matrix infra (404s were at least coming from https:matrix-client.matrix.org when i checked (altho would not be surprised if https://mozilla.modular.im does the same); the docs to exact api that is senselessly failing were linked above by Andreu Botella (he/they) (thnx!), but seems like we needed to dig further..

The homeserver SHOULD be able to supply thumbnails for uploaded images and videos. The exact file types which can be thumbnailed are not currently specified [...]
https://matrix.org/docs/spec/client_server/r0.6.1#id407

[...] with the exception of SVG which is particularly vulnerable to exploding clients thanks to billion lol attacks.
https://github.com/matrix-org/matrix-doc/issues/1938#issue-424877225

XXXbz? the api in question does not currently specify which media formats are supported (or perhaps, more importantly, unsupported), but one of the peeps in that issue seems to have safety concerns, particularly w/ svg thumbnails for some reason

18:37
<Andreu Botella (he/they)>
DerekNonGeneric: I think the difference with thumbnails is that the homeserver doesn't have to process the full-res image, it can just store it as is. But for generating thumbnails, the homeserver has to parse the image, and the billion laughs attack is a well known denial of service attack against XML formats
18:38
<Andreu Botella (he/they)>
https://en.wikipedia.org/wiki/Billion_laughs_attack
18:42
<DerekNonGeneric>
oh wow, til -- thanks!
18:46
<DerekNonGeneric>
wonder if https:matrix-client.matrix.org was forced to block that format for this api due to shenanigans
18:49
<Andreu Botella (he/they)>
From a quick look at the code, it seems like the development version of Synapse doesn't generate thumbnails for SVGs, so it's not a matrix.org only thing
18:50
<Andreu Botella (he/they)>
But I'll check it later today and maybe ask on #synchronicity:mozilla.org if they're using any patches to Synapse that might fix that
18:50
<Andreu Botella (he/they)>
g2g right now tho
18:50
<DerekNonGeneric>
cool, thnx -- keep me posted tho
18:51
<Luca Casonato>
"generating a thumbnail for SVG" sounds like a fun project. shouldn't it just proxy the original image? SVG is scalable after all 😉
18:53
<Andreu Botella (he/they)>
"generating a thumbnail for SVG" sounds like a fun project. shouldn't it just proxy the original image? SVG is scalable after all 😉
https://github.com/matrix-org/synapse/issues/1309#issuecomment-258911034
19:02
<DerekNonGeneric>

welll if modding the svg's xml is ok, firstly id run security checks for at least billion lol attacks, after that i would probably run the svgs through a minifier, then after that:

| x      | y       | z                                                                                                          |
| ------ | ------- | ---------------------------------------------------------------------------------------------------------- |
| width  | integer | Required. The desired width of the thumbnail. The actual thumbnail may be larger than the size specified.  |
| height | integer | Required. The desired height of the thumbnail. The actual thumbnail may be larger than the size specified. |

Source: https://matrix.org/docs/spec/client_server/r0.6.1#get-matrix-media-r0-thumbnail-servername-mediaid

id simply modify the width and height attribs on the root svg element

would need to actually test it out, but maybe mucking w/ the viewbox dimensions (also on the root svg element)?

19:24
DerekNonGeneric
questions the lack of rendered markdown table support in messages?
19:35
<DerekNonGeneric>
anyways, svgs would likely be able to fit the thumbnail api w/o causing distortion to the original image and the security concern could likely be mitigated by validating image uploads (like [at the very least] at the point when the user uploads their avatar [ altho unsure if due diligence can be expected of all participating homeservers ])