Because of the lack of support for SVG in current web browsers we need a solution for showing the users the icons within our project MAP-it.
The default GD library doesn’t support the SVG graphic format. We had to turn to Image Magick. If you are not allowed to execute on your webserver you can’t use the Image Magick Library from Linux. But you can always ask your webhost to install the iMagick php library which offers the same functionality without requiring exec() rights.
For testing purposes you can install iMagick php extension on your local webserver by following these instructions for windows and these instructions for mac.
Documentation for the iMagick library can be found here. Another very good example is from the creator of iMagick and can be read here.
We used the iMagick library in order to be able to view the users uploaded icon in every browser.
The image from the svg:
$image=new imagick(); $image->readImage($file); $image->setImageFormat('png'); $image->writeImage($pngpath);
where $file is the SVG path.
Copy from http://www.dough.be