Tag: imagick

readimageblob:将SVG转换为PNG时出现致命错误

我正在尝试使用Image-Magick和PHP将SVG文本转换为PNG图像。 此SVG是使用NVD3生成的图表,我希望允许我的用户将其下载为图像。 基本上,我将用JSON编码的SVG数据发送到PHP处理程序,该处理程序应该将其输出为PNG图像。 但是,这会引发以下错误: Fatal error: Uncaught exception ‘ImagickException’ with message ‘no decode delegate for this image format `’ @ blob.c/BlobToImage/347′ in svg2png.php:4 Stack trace: #0 svg2png.php(4): Imagick->readimageblob(‘ 用于转换图像的PHP脚本 : readImageBlob($svg); $im->setImageFormat(“png24”); header(“Content-Type: image/png”); $thumbnail = $im->getImageBlob(); echo $thumbnail; ?> HTML: jQuery的: exportSpendTrend = function (e) { //Show the user the PNG-image version for download […]