I looked into this, and basically haven't found anything "lightweight" to do it. I'm using Inkscape in command line mode for the transformation, and you can also use it (using the -z command line parameter) on unixish operating systems, but if you're using Debian, I found that it still wants to pull in Glib, GTk2 and lots of other bloat. I found the recommentation of librsvg2, which also has a commandline SVG renderer, but it also wanted to pull in Glib and GTk2.
I'm not sure why you think that ImageMagick won't run in a shared environment though - ImageMagick will run well in a shared environment.
| [reply] [d/l] [select] |
It could be that I don't fully understand your situation and contraints, but it sounds like you may be going all-out when a simpler solution might do the trick.
Why not use your webserver app to do the transcoding on your end, then provide an additional download link that users can click on to download a png version of the image.
If there is a specific need for the client machine/browser to do the transcoding, please reply with further detail.
| [reply] |
First, to answer last question, this is my requirement: a "save as image" link that would download a png version of the current svg displayed. This needs to be dynamic generation as the image depends on user actions on the browser that will alter the svg.
Maybe I misunderstand something about using ImageMagick. I got the impression that the piece of Software needs to be installed on the server (which the web host provider will not do). Is that incorrect ?
| [reply] |
I'm not aware of any SVG to PNG solution that does not require software, or at least a module, to be installed on the server. ImageMagick is a module that would need to be installed on the server.
As an alternative to SVG, maybe you want to use GD and GD::SVG or SVG::GD, which will allow you to produce graphs in both SVG and PNG (or GIF) formats.
If you're lucky, your webhoster has a C compiler installed on the hosting machine so you can compile and install ImageMagick or any of the other solutions yourself. Other than that, you'll have to either find another solution than producing SVG images in the first place, or find a webhoster that is willing to accomodate its paying customers better.
| [reply] |
There doesn't seem to be much info on the subject but I guess the requirement is quite sensible and there must be some way to do this.
Your requirement is not sensible. Use ImageMagick.
If you need convincing to stick with ImageMagick, see SVG::SVG2zinc and SVG::Convert.
| [reply] |