Image SVG conversion in Ruby on Rails

1

I have an application in rails and there I generate SVG images to return to the user via email, but I want to return this in another format (png or jpg). Does anyone have any tips on how I can do this?

    
asked by anonymous 17.04.2015 / 20:46

1 answer

0

Use gem mini_magick link

If you use Ubuntu, you need to have the imagemagick and librsvg2-bin installed

image = MiniMagick::Image.open("input.svg")
image.format "png"
image.write "output.png"
    
26.04.2015 / 18:03