this post was submitted on 03 Nov 2024
54 points (96.6% liked)

Ask Lemmy

26916 readers
1503 users here now

A Fediverse community for open-ended, thought provoking questions

Please don't post about US Politics. If you need to do this, try !politicaldiscussion@lemmy.world


Rules: (interactive)


1) Be nice and; have funDoxxing, trolling, sealioning, racism, and toxicity are not welcomed in AskLemmy. Remember what your mother said: if you can't say something nice, don't say anything at all. In addition, the site-wide Lemmy.world terms of service also apply here. Please familiarize yourself with them


2) All posts must end with a '?'This is sort of like Jeopardy. Please phrase all post titles in the form of a proper question ending with ?


3) No spamPlease do not flood the community with nonsense. Actual suspected spammers will be banned on site. No astroturfing.


4) NSFW is okay, within reasonJust remember to tag posts with either a content warning or a [NSFW] tag. Overtly sexual posts are not allowed, please direct them to either !asklemmyafterdark@lemmy.world or !asklemmynsfw@lemmynsfw.com. NSFW comments should be restricted to posts tagged [NSFW].


5) This is not a support community.
It is not a place for 'how do I?', type questions. If you have any questions regarding the site itself or would like to report a community, please direct them to Lemmy.world Support or email info@lemmy.world. For other questions check our partnered communities list, or use the search function.


Reminder: The terms of service apply here too.

Partnered Communities:

Tech Support

No Stupid Questions

You Should Know

Reddit

Jokes

Ask Ouija


Logo design credit goes to: tubbadu


founded 1 year ago
MODERATORS
 

I find it very weird that Lemmy support gifs but does not support svg format, is there is a specific reason for that?

top 16 comments
sorted by: hot top controversial new old
[–] mp3@lemmy.ca 39 points 2 weeks ago* (last edited 2 weeks ago) (1 children)

Because the backend for media storage in Lemmy is pictrs, and svg isn't one of the supported file format.

That said, I wish as the instance admin that we could store some custom emojis as svg :(

We could make them very light on resources, and easily scalable.

[–] ptz@dubvee.org 24 points 2 weeks ago* (last edited 2 weeks ago) (1 children)

Looks like you can embed SVGs in markdown, and they render (tested in Tesseract and Lemmy-UI). So if you link them externally, support is technically there.

Lemmy Logo SVG

EmojiMart also supports SVG for custom emojis. So I guess if you host SVG custom emojis from a static folder, they should work as-is, though you'd need to add them to the database manually (which is a Lemmy UI limitation since it only presents an upload field rather than a URL field).

But yeah, pict-rs seems to be the roadblock for "native" support.

[–] aeronmelon@lemmy.world 7 points 2 weeks ago (1 children)
[–] ptz@dubvee.org 4 points 2 weeks ago (1 children)

Nice. I figure all the web-based ones should unless they've got a static list of image types that doesn't include svg. The installed apps could be hit or miss depending on how they're implemented.

[–] swab148@lemm.ee 3 points 2 weeks ago (1 children)
[–] ouRKaoS 2 points 2 weeks ago

The spoiler tag doesn't work either, lol

[–] tal 14 points 2 weeks ago* (last edited 2 weeks ago) (2 children)

I haven't looked into any actual decision process, and personally, I'd like to be able to post vector files myself, but there are some real concerns that I suspect apply (and are probably also why other sites, like Reddit, don't provide SVG support).

  • SVG can contain Javascript, which can introduce security concerns

  • My guess is that there are resource-exhaustion issues. With a raster format, like, say, PNG, you're probably only going to create issues with very large images, which are easy to filter out -- and the existing system does place limits on that. With a typical, unconstrained vector format like Postscript or SVG, you can probably require an arbitrarily long amount of rendering time from the renderer (and maybe memory usage, dunno, don't know how current renderers work).

  • At least some SVG renderers support reference of external files. That could permit, to some degree, deanonymizing people who view them -- like, a commenter could see which IP addresses are viewing a comment. That's actually probably a more general privacy issue with Lemmy today, but it can at least theoretically be addressed by modifying Threadiverse server software to rewrite comments and by propagating and caching images, whereas SVG support would bake external reference support in.

I think that an environment that permits arbitrary vector files to be posted would probably require some kind of more-constrained format, or at minimum, some kind of hardened filter on the instance side to block or process images to convert them into a form acceptable for mass distribution by anonymous users.

Note that Lemmy does have support for other format than SVG, including video files -- just not anything vector ATM.

If the art you want to post is flat-color, my guess is that your closest bet is probably posting a raster version of it as PNG or maybe lossless webp.

Can also store an SVG somewhere else that permits hosting SVG and provide an external link to that SVG file.

[–] pelya@lemmy.world 7 points 2 weeks ago

Most vector rendering libraries have options to disable all the fancy stuff like Javascript and external links. If you manage to find one that supports it in the first place. As for resource usage, the server sends image files without decoding, so whatever forkbomb you will manage to include into your SVG will only crash Lemmy clients, so, 'not our problem'. Maybe it will become a problem for the server when generating thumbnail image.

[–] Zak@lemmy.world 2 points 2 weeks ago

propagating and caching images

This leads to the problem of abusive users trying to cause legal issues for server owners by introducing CSAM.

[–] Toes@ani.social 8 points 2 weeks ago

SVG does work but it's client/interface specific.

[–] abff08f4813c@j4vcdedmiokf56h3ho4t62mlku.srv.us 5 points 2 weeks ago (2 children)

So glad to be on pyfedi ( see piefed.social ) - which does support SVG

[–] Oha@lemmy.ohaa.xyz 2 points 2 weeks ago (1 children)

your instance url looks really sketchy

[–] abff08f4813c@j4vcdedmiokf56h3ho4t62mlku.srv.us 0 points 2 weeks ago (1 children)

There's a good reason for it - in short it's the price I pay for a free domain name.

I provided a longer and more in-depth explanation over at https://aussie.zone/post/14078235/12384427

[–] Oha@lemmy.ohaa.xyz 1 points 2 weeks ago (1 children)

You could also use https://nic.eu.org/ to get a nicer looking one

Cool, thanks for the suggestion!

Also, h/t to getting pointed to https://www.nten.org/change/savedotorg-campaign-history .. TIL!