How to check libpng version

NoDisplayName picture NoDisplayName · Nov 10, 2015 · Viewed 11.3k times · Source

I am using imagemagick and as far as I understand, it delegates handling of png files to libpng library, so I wonder how to check what libpng version is used?

Answer

Glenn Randers-Pehrson picture Glenn Randers-Pehrson · Nov 10, 2015

The simplest way is to run

convert -list format | grep PNG

or

identify -list format | grep PNG

This reports the libpng and zlib versions that are being used.

Sometimes you'll see something like

PNG* rw- Portable Network Graphics (libpng 1.6.17,1.6.18)

which means that ImageMagick was compiled with libpng-1.6.17 and is running with a newer shared library, libpng-1.6.18. This is harmless, unless this shows two incompatible versions, e.g., (libpng-1.2.44, 1.6.18).

On Ubuntu and other *nix platforms, you can also get useful information from

ldd `which convert`

Don't be puzzled if the latter command shows two or more instances of libpngNN; one is being used by coders/png.c to decode the PNGs and another is used within freetype, if you've installed freetype.