Add a preview for .svg images

コメント

15件のコメント

  • weird_pusheen

    Yes, this would be nice.

    4
  • digitalsadhu

    Please please yes, a thousand times yes!

    5
  • Rear_Admiral_Tarsus

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

    1. size: https://cdn.discordapp.com/attachments/538473237051604993/747611084210307103/example-ribbon.svg 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, https://wiki.mozilla.org/images/f/fa/Help_GraphViz_graph_G_neato.svg

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

    https://security.stackexchange.com/questions/11384/exploits-or-other-security-risks-with-svg-upload

     

    6
  • Eliza

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

    4
  • 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.

    -6
  • 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.

    6
  • CicadaNFT

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

    0
  • 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).

    1
  • 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.

    Size:
    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: https://github.com/CicadaNFT/Svg)

    -------------------------------------------
    YouTube video explaining SVGs:
    SVG Explained in 100 Seconds

    https://www.youtube.com/watch?v=emFMHH2Bfvo

    1
  • DJMoffinz

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

    1
  • Hittt

    Please add support to view SVGs in Discord. 

    1
  • coder

    Please support SVG!!!!

    It's lightweight and elegant!

    This is the new normal, come on!

    2
  • kevinpanpan

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

    1
  • DJMoffinz

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

    1
  • ">

    "</p>

    0

サインインしてコメントを残してください。