[英]ImageMagick No decode delegate for this image format
I work under windows and wamp server. 我在Windows和wamp服务器下工作。
this is my PHP code with Imagick 这是我用Imagick的PHP代码
$imagick = new Imagick($_SERVER['DOCUMENT_ROOT'] . '/' . $this->_name);
where $_SERVER['DOCUMENT_ROOT'].'/'.$this->_name
displays : 其中
$_SERVER['DOCUMENT_ROOT'].'/'.$this->_name
显示:
D:/Sources/my_project/public/media/2/9/1/05201502/55450e1b6543a05201502_9.PNG
d:/Sources/my_project/public/media/2/9/1/05201502/55450e1b6543a05201502_9.PNG
I checked that image and it does exist in the folder. 我检查了该图像,它确实存在于该文件夹中。
But Imagick throws an exception : 但是Imagick引发了一个异常:
Uncaught exception 'ImagickException' with message 'no decode delegate for this image format `D:/Sources/my_project/public/media/2/9/1/05201502/55450b10d8ea705201502_9.PNG' @ error/constitute.c/ReadImage/555' in D:\\Sources\\my_project\\library\\project\\Image.php on line 225
未捕获的异常'ImagickException',消息'没有此图像格式的解码委托'D:/Sources/my_project/public/media/2/9/1/05201502/55450b10d8ea705201502_9.PNG'@ error / construct.c / ReadImage / 555'在第225行的D:\\ Sources \\ my_project \\ library \\ project \\ Image.php中
I looked for a solution, but didn't find any, how can I fix this?? 我寻找一个解决方案,但没有找到任何解决方案,我该如何解决? thank you
谢谢
Update: This is the result when I type convert -version
in the command line : 更新:这是我在命令行中键入
convert -version
时的结果:
Version: ImageMagick 6.8.8-4 Q16 x86 2014-01-29 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC Modules OpenMP
Delegates: bzlib cairo freetype jbig jng jp2 jpeg lcms lqr pangocairo \
png ps rsv g tiff webp xml zlib
update 更新
This is the phpinfo of imagick. 这是imagick的phpinfo。
ImageMagick number of supported formats: 0
ImageMagick支持的格式数量:0
ImageMagick supported formats: no valueImageMagick支持的格式:没有价值
You should run 你应该跑
convert -version
and report the output. 并报告输出。 On my system it is
在我的系统上它是
Version: ImageMagick 6.9.0-0 Q16 x86_64 2014-12-06 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC Modules
Delegates (built-in): bzlib cairo djvu fftw fontconfig freetype gslib gvc jbig \
jng jp2 jpeg lcms lqr ltdl lzma openexr pangocairo png ps \
rsvg tiff webp wmf x xml zlib
Does your output include png
as one of the built-in 'delegates' ? 您的输出是否包含
png
作为内置“代理人”之一 ?
If not, update your installation, or build from current sources. 如果没有,请更新您的安装,或从当前源构建。
Seems that your ImageMagick PHP module does not support any image formats. 似乎您的ImageMagick PHP模块不支持任何图像格式。
Try to find other ImageMagick installation or install PHP from the scratch. 尝试找到其他ImageMagick安装或从头开始安装PHP。
Also - seems that there is already question/answer in SO about that 此外 - 似乎已经有关于此的问题/答案
Finally I found solution for my windows openserver/nginx/php-fpm installation: 最后我找到了我的windows openserver / nginx / php-fpm安装解决方案:
Sometimes phpinfo() displays that imagick supports all formats, but php scripts are not respond - in this case double check that you download correct version of Imagick-*.zip for your installations. 有时phpinfo()显示imagick支持所有格式,但php脚本没有响应 - 在这种情况下请仔细检查您是否为您的安装下载了正确版本的Imagick - * .zip。 (ts/nts, VC11/VC14, x64/x86)
(ts / nts,VC11 / VC14,x64 / x86)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.