1. 在http://www.imagemagick.org/download/上找到合适的版本,然后下载,我选择的版本是6.8.9:
wget http://www.imagemagick.org/download/ImageMagick-6.8.9-1.tar.gz
2. 解压刚才下载的文件:
tar xvf ImageMagick-6.8.9-1.tar.gz
3.进入解压目录:
cd ImageMagick-6.8.9-1
4.检查配置:
./configure
如果发现没有安装jpeg(如下图),则必须先安装jpeg
5.安装jpeg:
yum install libjpeg* libpng* freetype* gd*
6.安装ImageMagick
make install
输入convert -resize 100x100 src.jpg des.jpg 执行成功,表明安装成功
For other systems, create (or choose) a directory to install the package into and change to that directory, for example:
cd $HOME
Next, extract the contents of the package. For example:
tar xvzf ImageMagick.tar.gz
Set the MAGICK_HOME
environment variable to the path where you extracted the ImageMagick files. For example:
$ export MAGICK_HOME="$HOME/ImageMagick-7.0.7"
If the bin
subdirectory of the extracted package is not already in your executable search path, add it to your PATH
environment variable. For example:
export PATH="$MAGICK_HOME/bin:$PATH
On Linux and Solaris machines add $MAGICK_HOME/lib
to the LD_LIBRARY_PATH
environment variable:
LD_LIBRARY_PATH="${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$MAGICK_HOME/lib
export LD_LIBRARY_PATH
Finally, to verify ImageMagick is working properly, type the following on the command line: