Accept avatars in .svg format #10709

Closed
opened 2025-11-02 09:16:15 -06:00 by GiteaMirror · 5 comments
Owner

Originally created by @brobr on GitHub (Apr 21, 2023).

Feature Description

Related to https://github.com/go-gitea/gitea/issues/24263, and initially raised for .webp format at Codeberg, also avatars in .svg format are not accepted/recognized as an image. It would be nice if that format gets accepted as well.

Thanks.

Screenshots

No response

Originally created by @brobr on GitHub (Apr 21, 2023). ### Feature Description Related to https://github.com/go-gitea/gitea/issues/24263, and initially raised for `.webp` format at [Codeberg](https://codeberg.org/Codeberg/Community/issues/996), also avatars in `.svg` format are not accepted/recognized as an image. It would be nice if that format gets accepted as well. Thanks. ### Screenshots _No response_
GiteaMirror added the type/proposaltype/feature labels 2025-11-02 09:16:16 -06:00
Author
Owner

@delvh commented on GitHub (Apr 21, 2023):

The problem is: While it might seem like exactly the same feature, it is completely different:
webp is a "normal" image that works with the <img> tag.
svgs however need their own tag (<svg>).
So, this would need a complete rewrite of the logic.
That is such a huge change that I don't think the benefit is worth the effort.
It's far easier to require users to convert their svgs beforehand.
So, from my side this is a weak reject.
I don't know how other maintainers see it.

@delvh commented on GitHub (Apr 21, 2023): The problem is: While it might seem like exactly the same feature, it is **completely** different: `webp` is a "normal" image that works with the `<img>` tag. `svg`s however need their own tag (`<svg>`). So, this would need a complete rewrite of the logic. That is such a huge change that I don't think the benefit is worth the effort. It's far easier to require users to convert their svgs beforehand. So, from my side this is a weak reject. I don't know how other maintainers see it.
Author
Owner

@yardenshoham commented on GitHub (Apr 21, 2023):

I think you can do <img> with SVG https://caniuse.com/svg-img

@yardenshoham commented on GitHub (Apr 21, 2023): I think you can do `<img>` with SVG https://caniuse.com/svg-img
Author
Owner

@delvh commented on GitHub (Apr 21, 2023):

Okay, TIL.
In that case, my comment above is now outdated and no longer a blocker.

@delvh commented on GitHub (Apr 21, 2023): Okay, TIL. In that case, my comment above is now outdated and no longer a blocker.
Author
Owner

@wxiaoguang commented on GitHub (Apr 22, 2023):

Since JS code could be embedded in SVG, the security concern should be addressed first.

@wxiaoguang commented on GitHub (Apr 22, 2023): Since JS code could be embedded in SVG, the security concern should be addressed first.
Author
Owner

@silverwind commented on GitHub (Apr 22, 2023):

Duplicate with https://github.com/go-gitea/gitea/issues/8707. The challenge with SVG is security as SVGs can contain scripts so a proper sanitizer is needed. <img> tag will otherwise work fine.

@silverwind commented on GitHub (Apr 22, 2023): Duplicate with https://github.com/go-gitea/gitea/issues/8707. The challenge with SVG is security as SVGs can contain scripts so a proper sanitizer is needed. `<img>` tag will otherwise work fine.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#10709