参考:http://blog.csdn.net/hshxf/article/details/6128341
安装依赖包:
yum install libpng libpng-devel libjpeg libjpeg-devel gd gd-devel libtiff libtiff-devel
安装ImageMagick:
参考:https://www.archlinux.org/packages/extra/i686/imagemagick/
官网:http://www.imagemagick.org/
下载:https://sourceforge.net/projects/imagemagick/files/6.9.5-sources/
wget http://jaist.dl.sourceforge.net/project/imagemagick/6.9.5-sources/ImageMagick-6.9.5-7.tar.gz tar xzvf ImageMagick-6.9.5-7.tar.gz && cd ImageMagick-6.9.5-7 ./configure --prefix=/usr/local/imagemagick && make && make install
更新系统动态连接库配置:
echo /usr/local/imagemagick/lib >> /etc/ld.so.conf && ldconfig
安装jmagick:
下载:http://downloads.jmagick.org/
wget http://downloads.jmagick.org/6.4.0/jmagick-6.4.0-src.tar.gz tar xzvf jmagick-6.4.0-src.tar.gz && cd 6.4.0 ./configure --with-magick-home=/usr/local/imagemagick --with-magick-lib-dir=/usr/local/imagemagick/lib --with-magick-inc-dir=/usr/local/imagemagick/include/ImageMagick-6 && make && make install
cd lib && cp *.so /usr/lib/
部署:
cp jmagick.jar to your webapp/WEB-INF/lib/
更新系统动态连接库配置:
echo /usr/local/imagemagick/lib >> /etc/ld.so.conf && ldconfig
安装完成。
问题:
报错:
/usr/include/zlib.h:1385:21: note: expected ‘gzFile’ but argument is of type ‘struct FILE
参考:http://www.imagemagick.org/discourse-server/viewtopic.php?f=2&t=20267
因为系统zlib版本过高,因此下载ImageMagick最新版本进行安装。