Imagick:PNG支持在命令行中可用,但在PHP中不可用 [英] Imagick: PNG support available in command line, but not available in PHP

查看:256
本文介绍了Imagick:PNG支持在命令行中可用,但在PHP中不可用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现Imagick安装中没有PNG支持,因此我安装了 libpng .现在我可以看到在运行命令时支持PNG格式

convert -list format

从命令行将PNG转换为JPG效果很好

convert a.png b.jpg

但是当我尝试用PHP读取PNG文件时:

    $src = new \Imagick();
    $src->readImageBlob( file_get_contents($file) ); // reading PNG format

-它给我错误500("...此图像格式没有解码委托")

同样,当我运行phpinfo()时-Imagick支持的文件格式列表中没有看到PNG.还有很多,但没有PNG.

我试图安装树脂式PHP Imagick驱动程序,然后重新启动apache-仍然没有成功.

PS:我有PHP 5.4 @ CentOS

解决方案

问题已解决.

我从下面的链接中使用了Imagick @CentOS的安装指南,完全按照此处所说的那样重新安装了所有内容,并且它很有帮助-

Also when I run phpinfo() - I see no PNG in list of Imagick's supported file formats. There are many others, but no PNG.

I tried to I resintall PHP Imagick driver and then restart apache - still no succeess.

PS: I have PHP 5.4 @ CentOS

解决方案

Problem solved.

I used a guide for Imagick installation @CentOS from the link below, reinstalled everything exactly as it said there, and it helped - http://www.directadmin.com/forum/showthread.php?t=44449&page=1

这篇关于Imagick:PNG支持在命令行中可用,但在PHP中不可用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆