读书人

Ubuntu 上安装 ImageMagick

发布时间: 2012-09-23 10:28:11 作者: rapoo

Ubuntu 下安装 ImageMagick

1. 下载源代码包:ImageMagick.tar.gz

2. 解压后,cd ImageMagick-6.6.7-1

3. ./configure enable-shared enable-lzw without-perl with-modules

make

make install

4.执行 convert 命令,出现如下错误:error while loading shared libraries: libMagickCore.so.4: cannot open

shared object file: No such file or directory

不用慌,执行如下命令:ldconfig /usr/local/lib

再次执行 convert 命令,出现如下错误:convert: no decode delegate for this image format '1.jpg'

到这里,我有点抓狂了,但听同事说过这东西默认不支持jpeg格式,恍然间我开始想念windows了。

5. convert -list format ,查看格式后,确实没有发现jpeg 。

没关系,先从这个地址: http://www.imagemagick.org/download/delegates/ 下载:jpegsrc.v8b.tar.gz

仍然是解压后,执行如下命令:

./configure prefix=/usr

make

make install

6. 到这里还没完,你现在去convert仍然不行,必须重新安装 ImageMagick 。

如果你像我最初那样只是重新执行 make install ,哈哈,肯定是不行的。必须重新如下:

./configure enable-shared enable-lzw without-perl with-modules

make

make install

对!,必须重新编译一遍,虽然这个过程很漫长。

7. 此时,还不行我都打算砸电脑了。执行:convert 1.jpg 1-1.jpg 成功。

?

?

1 楼 raodun 2011-07-19 大哥,你这句 ./configure enable-shared enable-lzw without-perl with-modules
报错啊
configure: WARNING: you should use --build, --host, --target
configure: WARNING: invalid host type: enable-shared
configure: WARNING: you should use --build, --host, --target
configure: WARNING: invalid host type: enable-lzw
configure: WARNING: you should use --build, --host, --target
configure: WARNING: invalid host type: without-perl
configure: WARNING: you should use --build, --host, --target
configure: WARNING: invalid host type: with-modules
configuring ImageMagick 6.6.8-10
checking build system type... Invalid configuration `enable-shared': machine `enable' not recognized
configure: error: /bin/bash config/config.sub enable-shared failed

读书人网 >图形图像

热点推荐