阅读数:

linux ImageMagick安装

0

说明

最近在做node服务器端截取图片的功能,用到了gm,但gm安装需要依赖ImageMagick,ImageMagick安装过程相当曲折,
经过踩坑2次,最终得以安装成功,以下是具体步骤

安装步骤

  • 1、yum install libjpeg-devel libpng-devel libtiff-devel zlib-devel

  • 2、安装glibc2.14

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    wget http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
    tar -xvzf glibc-2.14.tar.gz
    cd glibc-2.14
    mkdir build
    cd build
    ../configure --prefix=/usr/local/glibc-2.14
    make -j4
    su
    xxxx
    make install
    whereis libc.so.6
    ln -s /usr/local/glibc-2.14/lib/libc-2.14.so /lib64/libc.so.6
    vim /root/.bash_profile
    添加:export LD_LIBRARY_PATH=/usr/local/glibc-2.14/lib:$LD_LIBRARY_PATH
    source /root/.bash_profile
  • 3、安装 jpeg依赖

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
wget http://www.ijg.org/files/jpegsrc.v9.tar.gz
tar -xvzf jpegsrc.v9.tar.gz
cd jpeg-9
./configure
make libdir=/usr/lib64
make libdir=/usr/lib64 install
```
* 4、安装ImageMagick
```
wget http://www.imagemagick.org/download/ImageMagick-6.9.9-13.tar.gz
tar -xvzf ImageMagick-6.9.9-13.tar.gz
cd ImageMagick-6.9.9-13
./configure
make
make install
  • 5、测试

./magick.sh /home/blj/test.jpg /home/blj/test.png


0
赏点咖啡钱^.^