Here's a link to my test: http://pestnow.herokuapp.com/tester/svg The image on the left is SVG, the one on the right is the PNG conversion. Here's the extremely simple code for the conversion:
def self.svg_to_png(svg)
img = Magick::Image::from_blob(svg)
return img[0].to_blob {self.format = 'PNG'}
end
I've been struggling with this problem and had this answered question here: SVG to PNG Conversion with ImageMagick doesn't handle defs? That question had to do with getting IM to do the conversion properly. And it DOES, from the command line with a simple "convert test.svg test.png"
But the RMagick conversion doesn't work the same. On my local dev box, I do have ImageMagick compiled with RVG support, and that fixed the command line. But I have no clue how to make RMagick use it the same way.
Furthermore, I'm hoping its something I need to do in my code, and not some feature required on the server, because this app is hosted on heroku and I have no control over how they install IM.