element-web icon indicating copy to clipboard operation
element-web copied to clipboard

We allow room avatars to be set to SVGs, but they then fail silently

Open come-maiz opened this issue 9 years ago • 14 comments

I'm trying to change the avatar in my room to this one: http://people.ubuntu.com/~elopio/testfiles/jaquerEspeis.svg

I go to the settings of the room and select the file, and it seems to load properly: ekrankopio de 2016-11-14 22-51-38 However, after I save it, the default icon remains: ekrankopio de 2016-11-14 23-01-24

I'm using ubuntu zesty, firefox 49.0 and https://riot.im/app/

come-maiz avatar Nov 15 '16 05:11 come-maiz

Yeah; SVGs don't work as room avatars. Updated the subject accordingly.

richvdh avatar Nov 15 '16 13:11 richvdh

The problem is that the avatar is set successfully, but when vector attempts to show it in the room, it tries to fetch a thumbnail, which fails.

Not sure what the right solution is here. Should we display the full image if fetching the avatar fails (as we appear to do in the Room Settings on first update)?

richvdh avatar Nov 15 '16 13:11 richvdh

We should do clientside-thumbnailing before uploading, i think, given we support this now for e2e attachments.

ara4n avatar Nov 25 '16 22:11 ara4n

see also #1833 and #1962

ara4n avatar Nov 25 '16 22:11 ara4n

When set they kinda work (clicking on the default room icon shows the SVG), but most of the UI ignores them and uses a default circular+text icon.

Currently once you set the avatar to be an SVG, you don't seem to be able to change it to anything else using RIOT (I haven't tried with anything else), which is definitely a problem!

I'm testing with https://github.com/rust-embedded/wg/blob/master/assets/logo/ewg-logo-blue-white-on-transparent.svg

linuxtim avatar Jun 25 '19 20:06 linuxtim

It should be possible to change them after setting, although the quick access might not be there anymore. The gear icon in the top right should bring you to room settings where you can click the square avatar and change it.

turt2live avatar Jun 25 '19 20:06 turt2live

Yes, the UI appears to offer that (as you described), but the change from svg to png doesn't seem to stick after the dialogue is closed (tried on both release and dev versions of RIOT).

  1. Set room avatar to https://github.com/rust-embedded/wg/blob/master/assets/logo/ewg-logo-blue-white-on-transparent.svg
  2. Set room avatar to https://github.com/rust-embedded/wg/blob/master/assets/logo/ewg-logo-blue-white-on-transparent.png

Browser: Firefox 67.0.4

linuxtim avatar Jun 25 '19 20:06 linuxtim

hmm, does the save button become enabled? It doesn't apply immediately to give people an opportunity to say "oh no, that's the wrong avatar".

turt2live avatar Jun 25 '19 21:06 turt2live

Can't see any save button.

linuxtim avatar Jun 25 '19 21:06 linuxtim

That's more worrying. It should be here: image

turt2live avatar Jun 25 '19 21:06 turt2live

OK, got it, sorry, because the avatar is off to the right, I didn't associate it with that save button, and assumed it would just immediately take effect (because no save button appeared to be associated with it).

The appearance is of a distinct element which is off in a right-hand side-bar I think.

So, the desired change worked, sorry for the noise on this bug, but probably the non-obviousness of the save button being associated with that preview is a UX bug.

linuxtim avatar Jun 25 '19 21:06 linuxtim

Indeed, I've opened https://github.com/vector-im/riot-web/issues/10170 to track this.

turt2live avatar Jun 25 '19 21:06 turt2live

as per https://github.com/vector-im/riot-web/issues/2008, we could just blat SVGs through https://github.com/cure53/DOMPurify to allow them in avatars.

ara4n avatar Sep 17 '19 22:09 ara4n

Hello, we just got hit by this any news on this, and it seems to affect the other Element clients as well. Over at #2008, @revolunet was offering help, any luck on that front?

LecrisUT avatar Aug 14 '24 10:08 LecrisUT

Hi, Recently, on Element Desktop linux, I uploaded a new image for avatar of a room. I choose a svg file, I wasn't aware that could cause troubles. The image wasn't showed. I guess this has to do with the format file svg. So I choose an other one. From there, strangely no image format (jpg, png) was working anymore on this element desktop linux. Strangely no new image is working in rooms anymore, only images before the svg try. I can send images but there aren't displayed on this element desktop linux client anymore.

I have an other device connected to the same account / server (synapse homeserver) on android with client element (not element X) and it still display correctly.

Has the svg file broken my element desktop linux client?

esp13 avatar Jan 02 '25 19:01 esp13

just.. disallow svgs as room icons or something? as is it just feels broken because it kinda-sorta works but actually doesn't, which is more frustrating than just rejecting the file type. there is error path code already, just show "not a valid image file" and get rid of this almost ten year old papercut

Valodim avatar Jul 31 '25 12:07 Valodim