Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Gordon Saxby 1460 posts 1881 karma points
    Aug 02, 2016 @ 17:35
    Gordon Saxby
    0

    Is Drag and Drop of SVG possible?

    Using Umbraco 7.4.2

    I am trying to setup Umbraco so that I can drag and drop SVG images into the Media library ... and have them created as images rather than files.

    Also, I would like a thumbnail to show when viewing in the Media Library and media pickers.

    I have removed "svg" from

    I manually created an Image media item and uploaded the SVG file and all seems to work OK ... so what can I do to allow drag & drop?

    It is fine if I need to do something via an event, or similar - I just need to know what I'm looking for!

  • Bojan 16 posts 131 karma points
    Aug 08, 2016 @ 10:55
    Bojan
    0

    I'm currently also looking for this answer.

  • Bjarne Fyrstenborg 1281 posts 3992 karma points MVP 8x c-trib
    Aug 08, 2016 @ 11:13
    Bjarne Fyrstenborg
    0

    I would say the reason why SVG are created as File media types instead of Image media types is because it is vector graphic, so they don't have values for e.g. height and width properties like jpg, gif and png have.

    I submitted a pull request, which render preview of SVG in an <img> element. https://github.com/umbraco/Umbraco-CMS/pull/1402

    /Bjarne

  • Gordon Saxby 1460 posts 1881 karma points
    Aug 08, 2016 @ 11:17
    Gordon Saxby
    0

    @Bjarne - the preview works fine if you first create an Image node and then upload the SVG file to that.

    So, it would be nice if the drag-drop process recognised SVG files and created them as Image types.

  • Bjarne Fyrstenborg 1281 posts 3992 karma points MVP 8x c-trib
    Aug 08, 2016 @ 11:26
    Bjarne Fyrstenborg
    0

    Yes, because it just render the uploaded file in an <img> element. But umbracoHeight and umbracoWidth properties are empty then.

    Not sure if it could cause some other issues, when working with the media type if it could both be raster and vector graphic.

Please Sign in or register to post replies

Write your reply to:

Draft