Imagick:PNG支持在命令行中可用,但在PHP中不可用 [英] Imagick: PNG support available in command line, but not available in 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屋!