2015-11-10 107 views

回答

3

最簡單的方法是運行

convert -list format | grep PNG 

identify -list format | grep PNG 

此報道,正在使用的的libpng和zlib版本。

有時你會看到類似

PNG * RW-便攜式網絡圖形(即libpng 1.6.17,1.6.18)

這意味着ImageMagick的用的libpng-1.6編譯.17並且正在運行一個更新的共享庫libpng-1.6.18。這是無害的,除非它顯示兩個不兼容的版本,例如(libpng-1.2.44,1.6.18)。

在Ubuntu和其他* nix平臺上,你也可以從中獲取有用的信息

ldd `which convert` 

如果是後者命令顯示libpngNN的兩個或多個實例不要疑惑;其中一個正被編碼器/ png.c用於解碼PNG,另一個用於freetype中,如果您已經安裝了freetype。

1

你可以試試以下兩種方法之一:

convert -debug coder xc: a.png 2>&1 | grep version 

    IM version  = 6.9.2-5 
    Libpng version = 1.6.18 
    Zlib version = 1.2.5 

或者,這

identify -list configure| grep CFLAGS 

CFLAGS   -I/usr/include/libxml2 -I/usr/local/Cellar/libpng/1.6.18/include/libpng16 -I/usr/local/Cellar/freetype/2.6_1/include/freetype2 -I/usr/local/Cellar/fontconfig/2.11.1/include -I/usr/local/Cellar/freetype/2.6_1/include/freetype2 -I/usr/local/Cellar/pixman/0.32.8/include/pixman-1 -I/usr/local/Cellar/glib/2.46.1_1/include/glib-2.0 -I/usr/local/Cellar/glib/2.46.1_1/lib/glib-2.0/include -I/usr/local/opt/gettext/include -I/usr/local/Cellar/cairo/1.14.4/include/cairo -D_REENTRANT -I/usr/local/Cellar/libpng/1.6.18/include/libpng16 -I/usr/local/Cellar/freetype/2.6_1/include/freetype2 -I/usr/local/Cellar/fontconfig/2.11.1/include -I/usr/local/Cellar/freetype/2.6_1/include/freetype2 -I/usr/local/Cellar/pixman/0.32.8/include/pixman-1 -I/usr/local/Cellar/glib/2.46.1_1/include/glib-2.0 -I/usr/local/Cellar/glib/2.46.1_1/lib/glib-2.0/include -I/usr/local/opt/gettext/include -I/usr/local/Cellar/cairo/1.14.4/include/cairo -I/usr/local/Cellar/gdk-pixbuf/2.32.1/include/gdk-pixbuf-2.0 -I/usr/local/Cellar/librsvg/2.40.11/include/librsvg-2.0 -I/usr/local/Cellar/libpng/1.6.18/include/libpng16 -I/usr/local/Cellar/xz/5.2.2/include -I/usr/local/Cellar/freetype/2.6_1/include/freetype2 -I/usr/local/Cellar/freetype/2.6_1/include/freetype2 -I/usr/local/Cellar/fontconfig/2.11.1/include -I/usr/local/Cellar/freetype/2.6_1/include/freetype2 -g -O2 -Wall -mtune=core2 -fexceptions -D_FORTIFY_SOURCE=0 -D_THREAD_SAFE -pthread -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 
PCFLAGS  -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 

或者,在Ubuntu

strace convert xc: a.png 2>&1 | grep open | grep libpng 
+0

我在默認配置的Ubuntu 14.04和第一個命令返回什麼都沒有,第二個沒有提及'libpng',有沒有機會它只是沒有安裝,雖然'imagemagick'工作得很好? – JustMichael

+0

爲Ubuntu添加了一個黑客... @ GlennRanders-Pehrson可能知道更優雅的東西。 –

+0

@ GlennRanders-Pehrson對於我的黑客來說,這更簡單,更可取 - 請繼續並自行發佈,您也可以獲得我的投票!感謝您的關注和保持誠實:-) –