Add a preview for .svg images



  • weird_pusheen

    Yes, this would be nice.

  • digitalsadhu

    Please please yes, a thousand times yes!

  • Rear_Admiral_Tarsus

    Hey, I would like to show some advantages of SVG:

    1. size: this svg is 660 bytes long, an equivalent image in jpg would be at least 2kb. (not counting quantization errors)

    2. interactivity: you can animate/have tooltips in svgs e.g.

    3. copy-paste: You can copy text out of svgs: e,g,

    About security, all javascript can be stripped out of plain text svgs. Also see the following wrt SVG security.


  • Eliza

    This is a feature I'd love to see, I hope they can add it

  • leagris

    SVG Images have the very same security risk and nightmare as HTML. SVG Can contain scripts, clickable URLs and can masquerade as System interface.

    It just means that displaying SVG safely, require some smart filtering and it may not be 100% safe whatever effort you put into it.

    This is the reason why, no website or app will display/share user submitted SVG images.

    This is frustrating and I also would like to be able to share SVG images with overview, but I prefer not risking being exposed to corrupted or harmful SVG content.

  • DenverCoder1

    GitHub allows embedding SVGs since they use <img> tags to display them. JavaScript and other issues are solved by simply using <img src="something.svg"> instead of embedding the svg directly.

  • CicadaNFT

    Seconded. This GitHub repo for example is able to display animated SVGs:
    I don't think it is a security or technical issue if done properly.

  • mataleone

    SVG is spreading fast, it's clean, cheap and beautiful.
    Less storage and bandwidth for Discord and us (I need to manage png version of my images just for Discord).

  • CicadaNFT

    Especially important for mobile users, SVGs are vastly more space efficient compared to raster images, allowing for a faster load time and lower data usage.

    SVG (4k resolution, lossless): 13 kb
    PNG (4k resolution, lossy): 290 kb
    PNG (4k resolution, lossless): 1281 kb
    GIF (2.5k resolution): 3024 kb

    SVG at 4k are a 22x - 99x space improvement over PNG !
    And the PNG are not animated like the SVG.

    We believe the security issues can be avoided (as proven by GitHub)
    • Use an Img Tag:

    <img src="./CicadaNFT.svg">

    • Limit the SVG upload size (the same way gifs are limited to 256 kb on Discord)
    • Sanitize by stripping out inline CSS and JavaScript

    (GitHub Repo showing an animated SVG:

    YouTube video explaining SVGs:
    SVG Explained in 100 Seconds

  • DJMoffinz

    I want this! SVG files are so much smaller than PNGs, so it would be great to have.

  • Hittt

    Please add support to view SVGs in Discord. 

  • coder

    Please support SVG!!!!

    It's lightweight and elegant!

    This is the new normal, come on!

  • kevinpanpan

    Please support it, at least in the browser version. It should be easy since all modern browsers support SVGs.

  • DJMoffinz

    it would be fairly simple in both versions, as i believe the discord desktop app is built with electron

  • ">