Uncaught exception 'ImagickException' with message 'UnableToOpenFile `
这是应用Imagick,将svg文件转换成png格式图片的功能。
在遇到readimageblob('<?xml version='...')函数就出现了下面的错误。请各位大侠帮忙解决下。
Uncaught exception 'ImagickException' with message 'UnableToOpenFile `C:/WINDOWS/TEMP/magick-gUHRtGiW': No such file or directory' in D:\Program Files\Apache Software Foundation\Apache2.2\htdocs\www1129\analytic\download.php:31
代码如下:
$im = new Imagick();
$svg = file_get_contents($filename);
$im->readImageBlob($svg);
$im->setImageFormat("png");
$im->resizeImage(720, 445, imagick::FILTER_LANCZOS, 1);
$im->setImageFormat("jpeg");
$im->adaptiveResizeImage(720, 445);
$im->writeImage('/filename.png');
$im->clear();
$im->destroy();