Upgrading libpng: shall we move to 1.4.x or 1.5.x?

Xose Vazquez Perez xose.vazquez at gmail.com
Fri Nov 4 22:59:54 UTC 2011


Henrik Nordström wrote:

> Documentaiton on how to adopt application code to work properly with
> libpng 1.4+ is readily available.

Some notes from upstream: http://www.libpng.org/pub/png/libpng.html

==cut==
Portability Note

The libpng 1.5.x series continues the evolution of the libpng API,
finally hiding the contents of the venerable and hoary png_struct
and png_info data structures inside private (i.e., non-installed)
header files. Instead of direct struct-access, applications should
be using the various png_get_xxx() and png_set_xxx() accessor
functions, which have existed for almost as long as libpng itself.
(Apps that compiled against libpng 1.4 without warnings about
deprecated features should happily compile against 1.5, too.) 

The above should not come as a particular surprise to anyone who
has added libpng support to an application this millenium; the
manual has warned of it since at least July 2000. (Specifically:
"Starting with version 2.0.0, both structures are going to be
hidden, and the contents of the structures will only be accessible
through the png_get/png_set functions." OK, so the version number
was off a bit...and the grammar, too, but who's counting?) Those
who are happy with the current level of PNG support in their apps
need not panic, however; libpng 1.2.x will continue to get
security fixes for the foreseeable future. (1.0.x has gotten them
for more than a decade even though Greg no longer bothers to list
that series here.)

The 1.5.x series also includes a new, more thorough test program
(pngvalid.c) and a new pnglibconf.h header file that tracks what
features were enabled or disabled when libpng was built. On the
other hand, it no longer internally includes the zlib.h header
file, so applications that formerly depended on png.h to provide
that will now need to include it explicitly. Complete differences
relative to libpng 1.4.x are detailed here.[1]

==end==

[1] Changes to Libpng from version 1.4.5 to 1.5.0 (January 6, 2011)
http://libpng.org/pub/png/src/libpng-1.4.x-to-1.5.x-summary.txt

Changes to Libpng from version 1.2.42 to 1.4.0 (January 4, 2010)
http://www.libpng.org/pub/png/src/libpng-1.2.x-to-1.4.x-summary.txt

ftp://ftp.simplesystems.org/pub/png/src/history/libpng-1.4.0-README.txt
ftp://ftp.simplesystems.org/pub/png/src/history/libpng-1.5.0-README.txt

API changes/compatibility test results for the libpng library
http://linuxtesting.org/upstream-tracker/versions/libpng.html




More information about the devel mailing list