centos - CentOS 上的 ImageMagick 无法处理 PNG 文件

标签 centos imagemagick png libpng

我在 CentOS 上使用 ImageMagik 时遇到问题。 错误是:

Error: identify: no decode delegate for this image format `PNG' @ error/constitute.c/ReadImage/501.

convert -list configure

Path: /usr/lib64/ImageMagick-6.5.4/config/configure.xml

Name          Value
-------------------------------------------------------------------------------
CC            gcc -std=gnu99
CFLAGS        -fopenmp -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -Wall -W -pthread
CONFIGURE     ./configure  '--build=x86_64-redhat-linux-gnu' '--host=x86_64-redhat-linux-gnu' '--target=x86_64-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib64' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/var/lib' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--enable-shared' '--disable-static' '--with-modules' '--with-perl' '--with-x' '--with-threads' '--with-magick_plus_plus' '--with-gslib' '--with-wmf' '--with-lcms' '--with-rsvg' '--with-xml' '--with-perl-options=INSTALLDIRS=vendor  CC='\''gcc -L/builddir/build/BUILD/ImageMagick-6.5.4-7/magick/.libs'\'' LDDLFLAGS='\''-shared -L/builddir/build/BUILD/ImageMagick-6.5.4-7/magick/.libs'\''' '--without-dps' '--without-included-ltdl' '--with-ltdl-include=/usr/include' '--with-ltdl-lib=/usr/lib64' 'build_alias=x86_64-redhat-linux-gnu' 'host_alias=x86_64-redhat-linux-gnu' 'target_alias=x86_64-redhat-linux-gnu' 'CFLAGS=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic' 'CXXFLAGS=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic'
COPYRIGHT     Copyright (C) 1999-2009 ImageMagick Studio LLC
CPPFLAGS      -I/usr/include/ImageMagick
CXX           g++
CXXFLAGS      -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -Wall -W -pthread
DEFS          -DHAVE_CONFIG_H
DELEGATES     bzlib fontconfig freetype gs jpeg jng jp2 lcms openexr png rsvg tiff x11 xml wmf zlib
DISTCHECK_CONFIG_FLAGS 'CFLAGS=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic' --disable-deprecated --with-quantum-depth=16 --with-umem=no --with-autotrace=no --with-dps=no --with-fontpath=
EXEC-PREFIX   /usr
HOST          x86_64-redhat-linux-gnu
LDFLAGS       -L/usr/lib64 -lfreetype
LIB_VERSION   0x654
LIB_VERSION_NUMBER 6,5,4,7
LIBS          -lMagickCore -llcms -ltiff -lfreetype -ljpeg -lfontconfig -lXext -lSM -lICE -lX11 -lXt -lbz2 -lz -lm -lgomp -lpthread -lltdl
NAME          ImageMagick
PCFLAGS       -fopenmp
PREFIX        /usr
QuantumDepth  16
RELEASE_DATE  2014-02-10
VERSION       6.5.4
WEBSITE       http://www.imagemagick.org

我可以在代表列表中看到“PNG”,但 LIBS 部分中似乎没有任何内容(见上文)。

我尝试安装 libpng,它已经安装,并且我已经从源代码重新安装了 ImageMagik,但它仍然无法工作。

有什么想法吗?

最佳答案

configure 尝试使用每个可用的图像委托(delegate)进行配置,因此当您从源代码构建时,您需要安装 libpng-devel 软件包。如果由于某种原因它没有检测到它,您可能需要尝试在配置选项中使用--with-png=yes强制它以获得一些反馈。

参见http://www.imagemagick.org/script/advanced-unix-installation.php

关于centos - CentOS 上的 ImageMagick 无法处理 PNG 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27954683/

相关文章:

php - 使用 php/windows 安装 ImageMagick 扩展

image-processing - 用高度替换区域的颜色 imagemagick

Python - pip install 找不到匹配的版本

linux - linux centos 无法解压zip文件

linux-kernel - 构建内核模块 CentOS6

html - 如何获得半透明的边框图像以显示其背后的边框颜色?

python - 使用python将灰度图像保存为4位png

linux - 有没有办法检查我的所有 shell 用户是否更改了密码

php - 如何生成直方图

php - 具有 PNG 扩展名的动态 PHP 图像