ImageMagick缺少解码代理 [英] ImageMagick missing decode delegates

查看:239
本文介绍了ImageMagick缺少解码代理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近搬到MediaTemple并按照他们的知识库文章安装了ImageMagick和IMagick 这里

I recently moved to MediaTemple and installed ImageMagick and IMagick following their KB article here.

没有错误和phpinfo()显示模块正确安装。

No error and phpinfo() show module correctly installed.

当我尝试通过PHP在JPG图像上使用IM时出现此错误

When I try to use IM on a JPG image via PHP I get this error

Uncaught exception 'ImagickException' with message 'no decode delegate for this image format 
/home/149263/domains/wer.com/html/images/pictures/post/tmp/original/' @ error/constitute.c/ReadImage/544' in /nfs/c10/h04/mnt/149263/domains/wer.com/html/application/controllers/post.php:301
Stack trace:
#0 /nfs/c10/h04/mnt/149263/domains/wer.com/html/application/controllers/post.php(301): Imagick->__construct('/home/149263/do...')
#1 [internal function]: Post->filter('punch')
#2 /nfs/c10/h04/mnt/149263/domains/wer.com/html/system/core/CodeIgniter.php(359): call_user_func_array(Array, Array)
#3 /nfs/c10/h04/mnt/149263/domains/wer.com/html/index.php(217): require_once('/nfs/c10/h04/mn...')
#4 {main} thrown in /nfs/c10/h04/mnt/149263/domains/wer.com/html/application/controllers/post.php on line 301

然而 convert -list configure 返回

DELEGATES     bzlib djvu fontconfig freetype gvc jpeg jp2 lcms openexr png rsvg tiff wmf x11 xml zlib

识别-list格式返回

JPEG* JPEG      rw-   Joint Photographic Experts Group JFIF format (62)
JPG* JPEG      rw-   Joint Photographic Experts Group JFIF format

所以看起来安装是正确的。

So it looks like the installation is correct.

ImageMagick 6.7.7-0 2012-05-22 
imagick module version  3.1.0RC1

有关如何解决此问题的任何建议吗?

Any suggestions how to troubleshoot this?

推荐答案

这是在Ubuntu 12.04上安装最新版本(撰写本文时为6.8.4-6)ImageMagick的快速和肮脏。

Here's a quick and dirty on installing the latest (version 6.8.4-6 as of this writing) ImageMagick on Ubuntu 12.04.

首先删除以前通过apt-get安装的旧版本:

Start by removing any old versions previously installed via apt-get:

sudo apt-get remove imagemagick

sudo apt-get remove imagemagick

然后更新apt-get并安装一些支持包:

Then update apt-get and install some supporting packages:

sudo apt-get update
sudo apt-get install libperl-dev gcc libjpeg-dev libbz2-dev libtiff4-dev libwmf-dev libz-dev libpng12-dev libx11-dev libxt-dev libxext-dev libxml2-dev libfreetype6-dev liblcms1-dev libexif-dev perl libjasper-dev libltdl3-dev graphviz pkg-config

使用wget从中获取源代码ImageMagick.org。

Use wget to grab the source from ImageMagick.org.

下载源代码后,将其解压缩:

Once the source is downloaded, uncompress it:

tar -xzf ImageMagick.tar.gz

现在配置并制作:

cd ImageMagick-6.8.4-6
./configure
sudo make
sudo make install

为避免出现如下错误:

To avoid an error such as:

convert: error while loading shared libraries: libMagickCore.so.2: cannot open shared object file: No such file or directory

将以下行添加到〜/ .bashrc

export LD_LIBRARY_PATH=/usr/local/lib

更新:如果仍然出现类似上面的错误,请尝试运行ldconfig:

Update: If you still get an error like the one above, try running ldconfig:

sudo ldconfig

您可以通过以下方式确认安装和可用格式:

You can confirm the install and available formats with:

identify -list format

这篇关于ImageMagick缺少解码代理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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