简体   繁体   English

ImageMagick没有此图像格式的解码委托

[英]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 value ImageMagick支持的格式:没有价值

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安装解决方案:

  1. Download latest php_imagick distributive for your version of PHP from http://windows.php.net/downloads/pecl/releases/imagick/ (eg php_imagick-3.4.3-7.1-ts-vc14-x64.zip) http://windows.php.net/downloads/pecl/releases/imagick/下载适用于您的PHP版本的最新php_imagick分发版(例如php_imagick-3.4.3-7.1-ts-vc14-x64.zip)
  2. Extract only php_imagick.dll from this archive to your "php/ext" folder. 从此存档中仅提取php_imagick.dll到您的“php / ext”文件夹。
  3. Run phpinfo() and check value at line "Imagick compiled with ImageMagick version" (mine was: "ImageMagick 6.9.3-7 Q16 x64 ..."). 运行phpinfo()并在“使用ImageMagick版本编译的Imagick”行检查值(我的是:“ImageMagick 6.9.3-7 Q16 x64 ......”)。
  4. Now go to http://windows.php.net/downloads/pecl/deps/ and download correct version of Imagick-*.zip file (mine was: ImageMagick-6.9.3-7-vc14-x64.zip). 现在转到http://windows.php.net/downloads/pecl/deps/并下载正确版本的Imagick - * .zip文件(我的是:ImageMagick-6.9.3-7-vc14-x64.zip)。
  5. Extact this archive and copy all *.dll files from "/bin" folder to yout "php/ext" folder (about 145 files). 取消此存档并将所有* .dll文件从“/ bin”文件夹复制到“php / ext”文件夹(约145个文件)。
  6. Restart server and check phpinfo(). 重启服务器并检查phpinfo()。 ImageMagick now supports about 230+ formats. ImageMagick现在支持大约230种格式。

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.

相关问题 在PHP iMagick中获取异常“对此图像格式无解码委托”,但不在ImageMagick上 - Getting exception 'no decode delegate for this image format' in PHP iMagick BUT NOT on ImageMagick Imagick - 此图像格式没有解码委托 - Imagick - no decode delegate for this image format Imagick SVG - 这种图像格式没有解码委托 - Imagick SVG - no decode delegate for this image format 突然收到ImageMagick“无解码委托”错误? - Suddenly getting ImageMagick “no decode delegate” errors? PHP Imagick - ImagickException(代码:420):此图像格式* .jpg没有解码委托 - PHP Imagick - ImagickException(code: 420): no decode delegate for this image format *.jpg PHP致命错误:未捕获异常'ImagickException',消息'此解码委托不适用于此图像格式 - PHP Fatal error: Uncaught exception 'ImagickException' with message 'no decode delegate for this image format 来自Imagick的readImageBlob函数抛出了一个错误,例如'No Decode Delegate for this Image Format' - readImageBlob function from Imagick is throwing an error like 'No Decode Delegate For This Image Format' 从ImageMagick for PHP中的二进制字符串解码图像对象 - Decode image object from binary string in ImageMagick for PHP ImageMagick缺少解码代理 - ImageMagick missing decode delegates 如何在cakePHP中将图像数据从二进制解码为png格式? - How to Decode image data from binary to png format in cakePHP.?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM