1. 安装一些必要的yum
yum install tcl-devel.x86_64 libpng-devel.x86_64 libjpeg-devel.x86_64 ghostscript-devel.x86_64 bzip2-devel.x86_64 freetype-devel.x86_64 libtiff-devel.x86_64
yum install libjpeg-devel.x86_64 libpng-devel.x86_64 glib2-devel.x86_64 fontconfig-devel.x86_64 zlib-devel.x86_64 libwmf-devel.x86_64 freetype-devel.x86_64 libtiff-devel.x86_64
2. 安装zlib
tar zxvf zlib-1.2.8.tar.gz
cd zlib-1.2.8
./configure
make
make install
3.步骤3:安装libpng
tar zxvf libpng-1.4.4.tar.gz
cd libpng-1.6.21
cd scripts/
mv makefile.linux ../makefile
cd ..
make
make install
4.安装freetype
tar zxvf freetype-2.1.10.tar.gz
cd freetype-2.1.10
./configure
make
make install
5.安装Jpeg
wget http://www.imagemagick.org/download/delegates/jpegsrc.v9b.tar.gz
tar zxvf pegsrc.v9b.tar.gz
cd jpeg-9b
./configure --enable-shared
make libdir=/usr/lib64
make libdir=/usr/lib64 install
6.安装ImageMagick
wget ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick.tar.gz
tar -xzvf ImageMagick-6.6.8-10.tar.gz
./configure --prefix=/usr/local/imagemagick
make
make install
7.修改环境变量
vim /etc/profile
export PATH=$PATH:$JAVA_HOME/bin:**/usr/local/imagemagick/bin**
source /etc/profile
8.测试(可选)
convert test.jpg a.jpg -geometry +75+180 -composite f_over.jpg
convert -background none -fill white -pointsize 36 label:A label_A_white.png
原文地址:https://www.cnblogs.com/ifme/p/12193580.html
时间: 2024-10-12 02:45:17