How to install ImageMagick in Linux

Source: Internet
Author: User
Tags imagemagick

How to install ImageMagick in Linux

Without graphical interface support, configuration on Linux (CentOS 5.4x64) is a little more difficult than Windows XP.

1. Download ImageMagick and JMagick source files (http://downloads.jmagick.org/6.4.0/): ImageMagick-6.4.0.-0tar.gz and jmagick-6.4.0-src.tar.gz.

2. Unzip and install ImageMagick:

# Tar xzvf ImageMagick-6.4.0-0.tar.gz

# Cd ImageMagick-6.4.0

#./Configure -- enable-shared -- without-perl

# Make

# Make install

# Make check

After the installation is complete, run the convert-version command to check whether:

Version: ImageMagick 6.4.0 08/31/10 Q16 http://www.imagemagick.org

Copyright: Copyright (C) 1999-2008 ImageMagick Studio LLC

Convert is installed under/usr/local/bin by default. The above command may prompt that the convert command cannot be found. You can create a link to/usr/local/bin/convert under/usr/bin:

# Cd/usr/bin

# Ln-s/usr/local/bin/convert

# Convet-version

3. modify the configuration file:

Add:

LD_LIBRARY_PATH =/usr/local/lib: $ LD_LIBRARY_PATH

Export LD_LIBRARY_PATH

Add/usr/local/lib to/etc/ld. so. conf.

4. configure the environment variables, especially JAVA_HOME, before installing JMagick. Otherwise, the following error occurs during compilation: JMagick configure: error: 'unable to locate Java directories.

# Export JAVA_HOME =/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0x86_64

# Export CLASSPATH = $ JAVA_HOME/lib: $ JAVA_HOME/jre/lib

# Export JAVA_BIN = $ JAVA_HOME/bin

# Export JRE_HOME = $ JAVA_HOME/jre

# Export PATH = $ PATH: $ JAVA_BIN

# Export JAVA_HOME CLASSPATH PATH

5. Install JMagick.

# Tar xzvf jmagick-6.4.0-src.tar.gz

Decompress the package to the folder 6.4.0. To facilitate differentiation, rename the folder:

# Music jmagick-6.4.0 6.4.0

# Cd jmagick-6.4.0

#./Configure

# Make all

# Make install

Copy the generated libJMagick-6.4.0.so to the lib/amd64 (amd64 may have different names in different hardware architectures, such as i386) folder, and rename it libJMagick. so.

# Cd/usr/local/lib

# Cp libJMagick-6.4.0.so $ JRE_HOME/lib/amd64

# Mv libJMagick-6.4.0.so libJMagick. so

Copy the jmagick-6.4.0.jar to the $ JRE_HOME/lib/ext folder and rename it jmagick. jar

# Cp jmagick-6.4.0/lib/jmagick-6.4.0.jar $ JRE_HOME/lib/ext/jmagick. jar

Now the configuration is complete.

6. You can also install ImageMagick using the yum command, but the version is 6.2.8. Because it is not sure whether it can be compatible with so and jar of 6.4.0, uninstall it and reinstall 6.4.0 according to the above steps.

Follow-up

Today, I changed the server security and encountered a new problem when installing ImageMagick:

./Magick/xwindow-private.h: 27: 21: error: X11/Xos. h: No such file or directory

Solution:

Search for packages that provide Xos. H files

# Yum provides */Xos. h

You will get a list of software packages:

Xorg-x11-proto-devel-7.1-13.el5.i386: X. Org X11 Protocol headers

Repo: base

Matched from:

Filename:/usr/include/X11/Xos. h

Install xorg-x11-proto-devel-7.1-13.el5.i386

Yum install xorg-x11-proto-devel

Yum install libjpeg-devel libpng-devel libtiff-devel

./Configure -- prefix =/usr/local/ImageMagick-6.4.0 -- without-bzlib -- with-jpeg = yes -- with-jp2 = yes -- with-png = yes -- without-x

Use ImageMagick to draw a three-color schematic diagram

In Linux, PHP supports ImageMagick and MagicWandForPHP.

Image Magic with ImageMagick in Linux

Installation of ImageMagick and MagicWand For PHP in Linux

Install ImageMagick and JMagick in Linux

For details about ImageMagick, click here
ImageMagick: click here

This article permanently updates the link address:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.