ImageMagick 不支持jpg格式时的处理办法
好像默认是没有支持的,可以这样看是否支持:
convert -list configure
注意看DELEGATES这行:
DELEGATES bzlib fontconfig freetype gs jpeg jp2 lcms lqr openexr png tiff x11 xml zlib
解决办法:
You may need to install other image type delegate libraries. See http://www.imagemagick.org/download/delegates/
jpeg要这个: jpegsrc.v6b.tar.gz.
服务器如果没有安装Jpeg v6b、libPng、FreeType 的要在安装imagemagick之前先装好,否则imagemagick没法读取jpeg和png图片,字体文件也读不了
这里有一些更详细的说明:
http://www.kakapo.cn/blog/read.php?125
./configure --prefix=/usr/local/jpeg8
================================================================================================
cd /tmp
tar xvzf ImageMagick-6.4.0-0.tar.gz
cd ImageMagick-6.4.0
./configure --prefix=/usr/local/ImageMagick-6.4.0 --enable-share --enable-static CPPFLAGS="-I/usr/local/jpeg8 -I/usr/local/jpeg8/include " LDFLAGS="-L/usr/local/lib -L/usr/local/jpeg8/lib"
make
make install
在安装JMagick之前先配置环境变量(/etc/profile),尤其是JAVA_HOME,否则编译时会出现: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
cd /tmp
tar xvzf jmagick-6.4.0-src.tar.gz
cd 6.4.0
./configure -prefix=/usr/local/jmagick --with-java-home=/usr/local/java/jdk1.6.0_25 --with-magick-home=/usr/local/ImageMagick-6.4.0 --enable-share --enable-static
make all
make install
cp /usr/local/jmagick/lib/jmagick-6.4.0.jar /usr/local/java/jdk1.6.0_25/jre/lib/ext/jmagick.jar
cp /usr/local/jmagick/lib/libJMagick.so /usr/local/java/jdk1.6.0_25/jre/lib/amd64/
今天换了一台服务器安,在安装ImageMagick时,出现了新的问题:
./magick/xwindow-private.h:27:21: error: X11/Xos.h: No such file or directory
解决方法:
查找提供Xos.h文件的包
# yum provides */Xos.h
会得到一个软件包的列表:
xorg-x11-proto-devel-7.1-13.el5.i386 : X.Org X11 Protocol headers
Repo : base
Matched from:
Filename : /usr/include/X11/Xos.h
安装xorg-x11-proto-devel-7.1-13.el5.i386即可
yum install xorg-x11-proto-devel
好像默认是没有支持的,可以这样看是否支持:
convert -list configure
注意看DELEGATES这行:
DELEGATES bzlib fontconfig freetype gs jpeg jp2 lcms lqr openexr png tiff x11 xml zlib
解决办法:
You may need to install other image type delegate libraries. See http://www.imagemagick.org/download/delegates/
jpeg要这个: jpegsrc.v6b.tar.gz.
服务器如果没有安装Jpeg v6b、libPng、FreeType 的要在安装imagemagick之前先装好,否则imagemagick没法读取jpeg和png图片,字体文件也读不了
这里有一些更详细的说明:
http://www.kakapo.cn/blog/read.php?125
./configure --prefix=/usr/local/jpeg8
================================================================================================
cd /tmp
tar xvzf ImageMagick-6.4.0-0.tar.gz
cd ImageMagick-6.4.0
./configure --prefix=/usr/local/ImageMagick-6.4.0 --enable-share --enable-static CPPFLAGS="-I/usr/local/jpeg8 -I/usr/local/jpeg8/include " LDFLAGS="-L/usr/local/lib -L/usr/local/jpeg8/lib"
make
make install
在安装JMagick之前先配置环境变量(/etc/profile),尤其是JAVA_HOME,否则编译时会出现: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
cd /tmp
tar xvzf jmagick-6.4.0-src.tar.gz
cd 6.4.0
./configure -prefix=/usr/local/jmagick --with-java-home=/usr/local/java/jdk1.6.0_25 --with-magick-home=/usr/local/ImageMagick-6.4.0 --enable-share --enable-static
make all
make install
cp /usr/local/jmagick/lib/jmagick-6.4.0.jar /usr/local/java/jdk1.6.0_25/jre/lib/ext/jmagick.jar
cp /usr/local/jmagick/lib/libJMagick.so /usr/local/java/jdk1.6.0_25/jre/lib/amd64/
今天换了一台服务器安,在安装ImageMagick时,出现了新的问题:
./magick/xwindow-private.h:27:21: error: X11/Xos.h: No such file or directory
解决方法:
查找提供Xos.h文件的包
# yum provides */Xos.h
会得到一个软件包的列表:
xorg-x11-proto-devel-7.1-13.el5.i386 : X.Org X11 Protocol headers
Repo : base
Matched from:
Filename : /usr/include/X11/Xos.h
安装xorg-x11-proto-devel-7.1-13.el5.i386即可
yum install xorg-x11-proto-devel