I am new to Imagick, and am trying to convert an svg to a png and resize it in php.
After trying numerous things, I still have an issue with how imagick reads the svg, it only shows the vectorized layers and not the rasterized layers.
This is my code:
Code: Select all
$image = new Imagick(); $image->readImage('./wp-content/uploads/REV-GEN4-NARROW_EVASION_SIDESHOT_FINAL.svg'); $image->setImageFormat("png"); $image->writeImage( "imagetest.png" ); header("Content-type: image/png"); echo $image->getImageBlob();
And this is what it looks like after Imagick reads it in the above code:
It should instead show everything, what am I doing wrong? Thanks.
I am using imagick module version 3.4.4 and ImageMagick 6.7.2-7