Copied to clipboard

Flag this post as spam?

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


  • Dennis Adolfi 1072 posts 6378 karma points MVP 2x c-trib
    Jun 15, 2017 @ 12:24
    Dennis Adolfi
    0

    Convert Media item SVG to png/jpg/x

    As the title reads, has anyone done this?

    Background:

    I have a client that has houndreds of media files uploaded, all SVG, that we now need in png or jpg format (because we're sending these files to an iOS app and apperantly SVG:s in iOS apps doesn't play well). The client doesn't want to manually upload an png representation of every image, so the feature request for some sort of converter has been asked for.

    I'm open for any ideas! Runtime converting or physicly saving a png image would also work, however that might add extra work since the client would need to update 2 media items if he wants to change a image.

    Note: I dont want to replace the SVG file, since we still need it. I just want a png representation of the media item as well.

    Thanks in advance!

  • Damiaan 438 posts 1290 karma points MVP 3x c-trib
    Jun 15, 2017 @ 12:37
    Damiaan
    101

    What I would consider is some kind of rasterizing library for SVG. If you have code that can convert an SVG to a bitmapped format, you can easily create an imageProcessor plugin which adds SVG as a recognized image format.

    I have done the same for reading in a PDF and show (the first page) as a PNG or JPEG. You can find the example here: https://github.com/dampee/ImageProcessor.Plugins.Pdf/

  • Dennis Adolfi 1072 posts 6378 karma points MVP 2x c-trib
    Jun 16, 2017 @ 05:43
    Dennis Adolfi
    0

    Thank you Damiaan! Yes I have the code for converting a svg to bitmap now, so I'll have a look at your plugin approach. I'll make sure to share my findings! Thanks again!

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies