---
title: "作个记号：Linux下安装ImageMagick和Jmagick"
author: "NetBus"
date: "2010-07-13T16:37:50Z"
tags: []
categories: ["非技术"]
slug: "linux-imagemagick-jmagick"
draft: false
lastmod: "2010-07-13T16:37:50Z"
id: 711744
url: "https://netbus.iteye.com/blog/711744"
---

怕搞忘，今天重装的时候碰了很多钉子，环境为：centos 5.4 x64：

 

### 1、装LibPNG，安装后才能处理png格式图片

 

```
tar -xzvf libpng-1.4.3.tar.gz
cd libpng-1.4.3
 ./configure
make
make install
```

 

### 2、安装JPEG包，安装后才能处理JPEG格式图片

 

```
tar -xzvf jpegsrc.v8b.tar.gz
cd jpeg-8b/
./configure --enable-shared --enable-static
make
make install
```

 

### 3、安装Tiff包，安装后才能处理TIFF格式图片

 

```
tar -xzvf tiff-3.8.0.tar.gz
cd tiff-3.8.0
./configure
make
make install
```

### 4、安装jasper包，安装后才能处理JPEG2000格式图片

 

```
unzip jasper-1.900.1.zip
cd jasper-1.900.1
CFLAGS=-fPIC  ./configure
make CFLAGS=-fPIC
make  CFLAGS=-fPIC install
```

### 5、安装ImageMagick。

 

```
tar -xzvf ImageMagick-6.6.3-0.tar.gz
cd ImageMagick-6.6.3-0
./configure --prefix=/opt/ImageMagick-6.6.3-0  --enable-share --enable-static  --with-jpeg=yes  --with-png=yes  --with-tiff=yes --with-jp2=yes --without-perl
make
make install
```

### 6、配置环境

 

```
echo "/usr/local/lib" > /etc/ld.so.conf.d/usr-local-lib.conf   
 ldconfig
```

### 7、安装Jmagick

 

```
PATH=$PATH:/usr/java/bin;export PATH
/configure --with-magick-home=/opt/ImageMagick-6.6.3-0/ --with-java-home=/usr/java/
make
make install
```

### 8、测试

 

```
cd /opt/ImageMagick-6.6.3-0/bin
./convert hehua.jpg –resize 50% hehua-resize.jpg
```