Commit b1645ebd authored by Aaron M. Ucko's avatar Aaron M. Ucko

[svn-upgrade] Integrating new upstream version, fltk1.1 (1.1.8~rc2)

parent 8dcaeaaa
......@@ -5,7 +5,8 @@ CHANGES IN FLTK 1.1.8
STR #1639, STR #1645, STR #1644, STR #1792, STR #1793,
STR #1742, STR #1777, STR #1794, STR #1827, STR #1843,
STR #1796, STR #1815, STR #1726, STR #1753, STR #1855,
STR #1862, STR #1867, STR #1874)
STR #1862, STR #1867, STR #1874, STR #1888)
- Fixed library path in Makefile (STR #1885)
- Fixed image read for partial regions on X11
(STR #1716)
- Fixed KDE/Gnome icon paths (STR #1795)
......
......@@ -121,14 +121,16 @@ INTERNET RESOURCES
FLTK is available on the 'net in a bunch of locations:
- WWW: http://www.fltk.org
- WWW: http://www.fltk.org/
http://www.fltk.org/str.php [for reporting bugs]
http://fltk.sourceforge.net
http://www.fltk.org/software.php [source code]
- FTP: http://ftp.easysw.com/pub/fltk
ftp://ftp2.easysw.com/pub/fltk
ftp://ftp3.easysw.com/pub/fltk
ftp://ftp.funet.fi/mirrors/ftp.easysw.com/pub/fltk
ftp://ftp.easysw.com/pub/fltk
ftp://ftp2.easysw.com/pub/fltk
ftp://ftp.funet.fi/pub/mirrors/ftp.easysw.com/pub/fltk
ftp://linux.mathematik.tu-darmstadt.de/pub/linux/mirrors/misc/fltk
ftp://gd.tuwien.ac.at/hci/fltk
- EMail: fltk@fltk.org [see instructions below]
......@@ -162,7 +164,7 @@ TRADEMARKS
COPYRIGHT
FLTK is copyright 1998-2006 by Bill Spitzak
FLTK is copyright 1998-2008 by Bill Spitzak
(spitzak@users.sourceforge.net) and others, including:
Craig P. Earls
......
......@@ -281,8 +281,8 @@ file names. The number of selected files is returned by
<P>This sample code loops through all selected files:
<PRE>
// Get list of filenames user selected from a MULTI chooser
for ( int t=1; t<=chooser->count(); t++ ) {
const char *filename = chooser->value(t);
for ( int t=1; t&lt;=chooser-&gt;count(); t++ ) {
const char *filename = chooser-&gt;value(t);
..
}
</PRE>
......
......@@ -321,6 +321,10 @@ make
<DT>WWW
<DD><A href="http://www.fltk.org/">http://www.fltk.org/</A>
<DD><A href="http://www.fltk.org/str.php">http://www.fltk.org/str.php</A>
[for reporting bugs]
<DD><A href="http://www.fltk.org/software.php">http://www.fltk.org/software.php</A>
[source code]
<DT>FTP
<DD><A HREF="ftp://ftp.fltk.org/pub/fltk">California, USA (ftp.fltk.org)</A>
......
#
# "$Id: fltk.list.in 6045 2008-02-25 14:43:34Z matt $"
# "$Id: fltk.list.in 6059 2008-02-28 16:50:07Z mike $"
#
# EPM product list file for the Fast Light Tool Kit (FLTK).
#
# (EPM can be found at http://www.easysw.com/epm/)
# (EPM can be found at http://www.epmhome.org/)
#
# Copyright 1998-2007 by Bill Spitzak and others.
# Copyright 1998-2008 by Bill Spitzak and others.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
......@@ -28,7 +28,7 @@
#
%product Fast Light Tool Kit (FLTK)
%copyright 1998-2007 by Bill Spitzak and others.
%copyright 1998-2008 by Bill Spitzak and others.
%vendor FLTK Development Team
%license COPYING
%readme README
......@@ -42,12 +42,12 @@
$prefix=@prefix@
$exec_prefix=@exec_prefix@
$bindir=@bindir@
$datadir=@datadir@
$datarootdir=@datarootdir@
$datadir=@datadir@
$includedir=@includedir@
$libdir=@libdir@
$mandir=@mandir@
$docdir=$(datadir)/doc/fltk
$docdir=${datadir}/doc/fltk
$CAT1EXT=@CAT1EXT@
$CAT3EXT=@CAT3EXT@
......@@ -395,18 +395,18 @@ f 0444 root sys /Applications/sudoku.app/Contents/Resources/sudoku.icns test/sud
%system !darwin
f 0555 root sys $bindir/blocks test/blocks
f 0444 root sys /usr/share/applications/blocks.desktop test/desktop/blocks.desktop
f 0444 root sys /usr/share/icons/hicolor/32x32/apps/blocks.png test/icons/blocks-32.png
f 0444 root sys /usr/share/icons/hicolor/128x128/apps/blocks.png test/icons/blocks-128.png
f 0444 root sys /usr/share/icons/hicolor/32x32/apps/blocks.png test/desktop/blocks-32.png
f 0444 root sys /usr/share/icons/hicolor/128x128/apps/blocks.png test/desktop/blocks-128.png
f 0555 root sys $bindir/checkers test/checkers
f 0444 root sys /usr/share/applications/checkers.desktop test/desktop/checkers.desktop
f 0444 root sys /usr/share/icons/hicolor/32x32/apps/checkers.png test/icons/checkers-32.png
f 0444 root sys /usr/share/icons/hicolor/128x128/apps/checkers.png test/icons/checkers-128.png
f 0444 root sys /usr/share/icons/hicolor/32x32/apps/checkers.png test/desktop/checkers-32.png
f 0444 root sys /usr/share/icons/hicolor/128x128/apps/checkers.png test/desktop/checkers-128.png
f 0555 root sys $bindir/sudoku test/sudoku
f 0444 root sys /usr/share/applications/sudoku.desktop test/desktop/sudoku.desktop
f 0444 root sys /usr/share/icons/hicolor/32x32/apps/sudoku.png test/icons/sudoku-32.png
f 0444 root sys /usr/share/icons/hicolor/128x128/apps/sudoku.png test/icons/sudoku-128.png
f 0444 root sys /usr/share/icons/hicolor/32x32/apps/sudoku.png test/desktop/sudoku-32.png
f 0444 root sys /usr/share/icons/hicolor/128x128/apps/sudoku.png test/desktop/sudoku-128.png
%system all
f 0444 root sys $mandir/cat6/blocks.$CAT6EXT documentation/blocks.$CAT6EXT
......@@ -417,5 +417,5 @@ f 0444 root sys $mandir/man6/checkers.6 documentation/checkers.man
f 0444 root sys $mandir/man6/sudoku.6 documentation/sudoku.man
#
# End of "$Id: fltk.list.in 6045 2008-02-25 14:43:34Z matt $".
# End of "$Id: fltk.list.in 6059 2008-02-28 16:50:07Z mike $".
#
#
# "$Id: fltk.spec.in 6045 2008-02-25 14:43:34Z matt $"
# "$Id: fltk.spec.in 6059 2008-02-28 16:50:07Z mike $"
#
# RPM spec file for FLTK.
#
# Copyright 1998-2007 by Bill Spitzak and others.
# Copyright 1998-2008 by Bill Spitzak and others.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
......@@ -35,7 +35,7 @@ Version: %{version}
Release: %{release}
License: LGPL
Group: System Environment/Libraries
Source: ftp://ftp.easysw.com/pub/fltk/1.1.8rc1.1/fltk-1.1.8rc1.1-source.tar.bz2
Source: ftp://ftp.easysw.com/pub/fltk/1.1.8rc2/fltk-1.1.8rc2-source.tar.bz2
URL: http://www.fltk.org/
Packager: FLTK Developer <fltk@fltk.org>
# use BuildRoot so as not to disturb the version already installed
......@@ -141,5 +141,5 @@ rm -rf $RPM_BUILD_ROOT
%{prefix}/share/icons/hicolor/*/apps/sudoku.png
#
# End of "$Id: fltk.spec.in 6045 2008-02-25 14:43:34Z matt $".
# End of "$Id: fltk.spec.in 6059 2008-02-28 16:50:07Z mike $".
#
#
# "$Id: fltk.spec.in 6045 2008-02-25 14:43:34Z matt $"
# "$Id: fltk.spec.in 6059 2008-02-28 16:50:07Z mike $"
#
# RPM spec file for FLTK.
#
# Copyright 1998-2007 by Bill Spitzak and others.
# Copyright 1998-2008 by Bill Spitzak and others.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
......@@ -141,5 +141,5 @@ rm -rf $RPM_BUILD_ROOT
%{prefix}/share/icons/hicolor/*/apps/sudoku.png
#
# End of "$Id: fltk.spec.in 6045 2008-02-25 14:43:34Z matt $".
# End of "$Id: fltk.spec.in 6059 2008-02-28 16:50:07Z mike $".
#
Libpng 1.2.16 - January 31, 2007
Libpng 1.2.25 - February 18, 2008
This is a public release of libpng, intended for use in production codes.
......@@ -8,39 +8,59 @@ Files available for download:
Source files with LF line endings (for Unix/Linux) and with a
"configure" script
libpng-1.2.16.tar.gz
libpng-1.2.16.tar.bz2
libpng-1.2.25.tar.gz
libpng-1.2.25.tar.lzma
(Get the lzma codec from <http://tukaani.org/lzma>).
libpng-1.2.25.tar.bz2
Source files with LF line endings (for Unix/Linux) without the
"configure" script
libpng-1.2.16-no-config.tar.gz
libpng-1.2.16-no-config.tar.bz2
libpng-1.2.25-no-config.tar.gz
libpng-1.2.25-no-config.tar.lzma
libpng-1.2.25-no-config.tar.bz2
Source files with CRLF line endings (for Windows), without the
"configure" script
lpng1216.zip
lpng1216.tar.bz2
lpng1225.zip
lpng1225.7z
lpng1225.tar.bz2
Project files
libpng-1.2.16-project-netware.zip
libpng-1.2.16-project-wince.zip
libpng-1.2.25-project-netware.zip
libpng-1.2.25-project-wince.zip
Other information:
libpng-1.2.16-README.txt
libpng-1.2.16-KNOWNBUGS.txt
libpng-1.2.16-LICENSE.txt
libpng-1.2.16-Y2K-compliance.txt
Changes since the last public release (1.2.15):
version 1.2.16 [January 31, 2007]
Fix bugs in makefile.nommx
Revised scripts/CMakeLists.txt
libpng-1.2.25-README.txt
libpng-1.2.25-KNOWNBUGS.txt
libpng-1.2.25-LICENSE.txt
libpng-1.2.25-Y2K-compliance.txt
libpng-1.2.25-1.2.24-diff.txt
Changes since the last public release (1.2.24):
version 1.2.25 [February 18, 2008]
Fixed bug with unknown chunk handling, introduced in version 1.2.17
Prevent gamma from being applied twice.
Fixed some continue-after-malloc-failure errors in pngset.c (David Hill)
Check for info_ptr == NULL in png_read_info() and png_process_data().
Check for possible use of NULL user_png_ver[] in png_create_read_struct().
Fix overflow of "msg" in png_decompres_chunk().
Added libpng-1.2.25.tar.lzma to distribution. Get the lzma codec
from <http://tukaani.org/lzma>.
Added lpng1225.7z to distribution. Get the 7-zip decoder from
from <http://www.7-zip.org>.
Fixed some broken links in the README file.
Refactored png_read_push_finish_row() slightly, trying to satisfy Coverity.
Fixed potential NULL dereference of png_ptr in png_destroy_write_struct();
clarified potential NULL dereference of png_ptr in png_destroy_read_struct();
fixed potential NULL dereference of info_ptr in png_handle_bKGD();
fixed potential NULL dereference of user_png_ver[] in
png_create_write_struct_2(). (Coverity)
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit
......
This diff is collapsed.
Installing libpng version 1.2.16 - January 31, 2007
Installing libpng version 1.2.25 - February 18, 2008
On Unix/Linux and similar systems, you can simply type
......@@ -44,7 +44,7 @@ to have access to the zlib.h and zconf.h include files that
correspond to the version of zlib that's installed.
You can rename the directories that you downloaded (they
might be called "libpng-1.2.16" or "lpng109" and "zlib-1.2.1"
might be called "libpng-1.2.25" or "lpng109" and "zlib-1.2.1"
or "zlib121") so that you have directories called "zlib" and "libpng".
Your directory structure should look like this:
......@@ -101,15 +101,9 @@ include
CMakeLists.txt => "cmake" script
makefile.std => Generic UNIX makefile (cc, creates static libpng.a)
makefile.elf => Linux/ELF makefile symbol versioning,
gcc, creates libpng12.so.0.1.2.16)
gcc, creates libpng12.so.0.1.2.25)
makefile.linux => Linux/ELF makefile
(gcc, creates libpng12.so.0.1.2.16)
makefile.gcmmx => Linux/ELF makefile
(gcc, creates libpng12.so.0.1.2.16,
uses assembler code tuned for Intel MMX platform)
makefile.nommx => Linux/ELF makefile
(gcc, creates libpng12.so.0.1.2.16
does not use Intel MMX assembler code)
(gcc, creates libpng12.so.0.1.2.25)
makefile.gcc => Generic makefile (gcc, creates static libpng.a)
makefile.knr => Archaic UNIX Makefile that converts files with
ansi2knr (Requires ansi2knr.c from
......@@ -131,12 +125,14 @@ include
makefile.openbsd => OpenBSD makefile
makefile.sgi => Silicon Graphics IRIX makefile (cc, creates static lib)
makefile.sggcc => Silicon Graphics (gcc,
creates libpng12.so.0.1.2.16)
creates libpng12.so.0.1.2.25)
makefile.sunos => Sun makefile
makefile.solaris => Solaris 2.X makefile (gcc,
creates libpng12.so.0.1.2.16)
creates libpng12.so.0.1.2.25)
makefile.solaris-x86 => Solaris/intelMMX 2.X makefile (gcc,
creates libpng12.so.0.1.2.25)
makefile.so9 => Solaris 9 makefile (gcc,
creates libpng12.so.0.1.2.16)
creates libpng12.so.0.1.2.25)
makefile.32sunu => Sun Ultra 32-bit makefile
makefile.64sunu => Sun Ultra 64-bit makefile
makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc
......@@ -152,10 +148,7 @@ include
makefile.tc3 => Turbo C 3.0 makefile
makefile.dj2 => DJGPP 2 makefile
makefile.msc => Microsoft C makefile
makefile.vcawin32 => makefile for Microsoft Visual C++ 5.0 and later (uses
assembler code tuned for Intel MMX platform)
makefile.vcwin32 => makefile for Microsoft Visual C++ 4.0 and later (does
not use assembler code)
makefile.vcwin32 => makefile for Microsoft Visual C++ 4.0 and later
makefile.os2 => OS/2 Makefile (gcc and emx, requires pngos2.def)
pngos2.def => OS/2 module definition file used by makefile.os2
makefile.watcom => Watcom 10a+ Makefile, 32-bit flat memory model
......@@ -204,23 +197,3 @@ instead, as demonstrated in contrib/visupng of the libpng distribution.
Further information can be found in the README and libpng.txt
files, in the individual makefiles, in png.h, and the manual pages
libpng.3 and png.5.
Using the ./configure script -- 16 December 2002.
=================================================
The ./configure script should work compatibly with what scripts/makefile.*
did, however there are some options you need to add to configure explicitly,
which previously was done semi-automatically (if you didn't edit
scripts/makefile.* yourself, that is)
CFLAGS="-Wall -O3 -funroll-loops \
-malign-loops=2 -malign-functions=2" ./configure --prefix=/usr/include \
--with-pkgconfigdir=/usr/lib/pkgconfig --includedir=/usr/include
You can alternatively specify --includedir=/usr/include, /usr/local/include,
/usr/include/png12, or whatever.
Known bugs in libpng version 1.2.16
Known bugs in libpng version 1.2.25
1. April 22, 2001: pnggccrd.c has been reported to crash on NetBSD when
reading interlaced PNG files, when assembler code is enabled but running
on a non-MMX i386 platform.
STATUS: Under investigation. The change to pnggccrd.c in libpng-1.2.1
fixed a problem under FreeBSD but not the problem with NetBSD, which
still fails as of libpng-1.2.2rc1.
2. February 23, 2006: The custom makefiles don't build libpng with -lz.
1. February 23, 2006: The custom makefiles don't build libpng with -lz.
STATUS: This is a subject of debate. The change will probably be made
as a part of a major overhaul of the makefiles in libpng version 1.3.0.
as a part of a major overhaul of the makefiles in libpng version 1.4.0.
3. February 24, 2006: The Makefile generated by the "configure" script
2. February 24, 2006: The Makefile generated by the "configure" script
fails to install symbolic links
libpng12.so => libpng12.so.0.1.2.9betaN
that are generated by the custom makefiles.
STATUS: For now, system library builders should use the custom makefiles.
3. September 4, 2007: There is a report that pngtest crashes on MacOS 10.
STATUS: workarounds are
1) Compile without optimization (crashes are observed with
-arch i386 and -O2 or -O3, using gcc-4.0.1).
2) Compile pngtest.c with PNG_DEBUG defined (the bug goes away if
you try to look at it).
3) Ignore the crash. The library itself seems to be OK.
......@@ -8,8 +8,8 @@ COPYRIGHT NOTICE, DISCLAIMER, and LICENSE:
If you modify libpng you may insert additional notices immediately following
this sentence.
libpng versions 1.2.6, August 15, 2004, through 1.2.16, January 31, 2007, are
Copyright (c) 2004, 2006 Glenn Randers-Pehrson, and are
libpng versions 1.2.6, August 15, 2004, through 1.2.25, February 18, 2008, are
Copyright (c) 2004, 2006-2008 Glenn Randers-Pehrson, and are
distributed according to the same disclaimer and license as libpng-1.2.5
with the following individual added to the list of Contributing Authors
......@@ -106,4 +106,4 @@ certification mark of the Open Source Initiative.
Glenn Randers-Pehrson
glennrp at users.sourceforge.net
January 31, 2007
February 18, 2008
README for libpng version 1.2.16 - January 31, 2007 (shared library 12.0)
README for libpng version 1.2.25 - February 18, 2008 (shared library 12.0)
See the note about version numbers near the top of png.h
See INSTALL for instructions on how to install libpng.
Libpng comes in several distribution formats. Get libpng-*.tar.gz
or libpng-*.tar.bz2 if you want UNIX-style line endings in the text
files, or lpng*.zip if you want DOS-style line endings.
Libpng comes in several distribution formats. Get libpng-*.tar.gz,
libpng-*.tar.lzma, or libpng-*.tar.bz2 if you want UNIX-style line
endings in the text files, or lpng*.7z lpng*.zip if you want DOS-style
line endings.
Version 0.89 was the first official release of libpng. Don't let the
fact that it's the first release fool you. The libpng library has been in
......@@ -77,12 +78,12 @@ compression library that is useful for more things than just PNG files.
You can use zlib as a drop-in replacement for fread() and fwrite() if
you are so inclined.
zlib should be available at the same place that libpng is, or at.
ftp://ftp.info-zip.org/pub/infozip/zlib
zlib should be available at the same place that libpng is, or at
ftp://ftp.simplesystems.org/pub/png/src/
You may also want a copy of the PNG specification. It is available
as an RFC, a W3C Recommendation, and an ISO/IEC Standard. You can find
these at http://www.libpng.org/pub/png/documents/
these at http://www.libpng.org/pub/png/pngdocs.html
This code is currently being archived at libpng.sf.net in the
[DOWNLOAD] area, and on CompuServe, Lib 20 (PNG SUPPORT)
......@@ -113,8 +114,8 @@ given in previous versions of this document. He and Andreas will read mail
addressed to the png-implement list, however.
Please do not send general questions about PNG. Send them to
the (png-list at ccrc.wustl.edu, subscription required, write to
majordomo at ccrc.wustl.edu with "subscribe png-list" in your message).
the (png-mng-misc at lists.sourceforge.net, subscription required, visit
https://lists.sourceforge.net/lists/listinfo/png-mng-implement to subscribe)
On the other hand,
please do not send libpng questions to that address, send them to me
or to the png-implement list. I'll
......@@ -125,7 +126,7 @@ and ...". If in doubt, send questions to me. I'll bounce them
to others, if necessary.
Please do not send suggestions on how to change PNG. We have
been discussing PNG for nine years now, and it is official and
been discussing PNG for twelve years now, and it is official and
finished. If you have suggestions for libpng, however, I'll
gladly listen. Even if your suggestion is not used immediately,
it may be used later.
......@@ -140,6 +141,7 @@ Files in this distribution:
TODO => Things not implemented in the current library
Y2KINFO => Statement of Y2K compliance
example.c => Example code for using libpng functions
libpng-*-*-diff.txt => Diff from previous release
libpng.3 => manual page for libpng (includes libpng.txt)
libpng.txt => Description of libpng and its functions
libpngpf.3 => manual page for libpng's private functions
......@@ -147,7 +149,6 @@ Files in this distribution:
png.c => Basic interface functions common to library
png.h => Library function and interface declarations
pngconf.h => System specific library configuration
pngasmrd.h => Header file for assembler-coded functions
pngerror.c => Error/warning message I/O functions
pngget.c => Functions for retrieving info from struct
pngmem.c => Memory handling functions
......@@ -190,11 +191,11 @@ Files in this distribution:
descrip.mms => VMS makefile for MMS or MMK
makefile.std => Generic UNIX makefile (cc, creates static libpng.a)
makefile.elf => Linux/ELF makefile symbol versioning,
gcc, creates libpng12.so.0.1.2.16)
gcc, creates libpng12.so.0.1.2.25)
makefile.linux => Linux/ELF makefile
(gcc, creates libpng12.so.0.1.2.16)
(gcc, creates libpng12.so.0.1.2.25)
makefile.gcmmx => Linux/ELF makefile
(gcc, creates libpng12.so.0.1.2.16,
(gcc, creates libpng12.so.0.1.2.25,
uses assembler code tuned for Intel MMX platform)
makefile.gcc => Generic makefile (gcc, creates static libpng.a)
makefile.knr => Archaic UNIX Makefile that converts files with
......@@ -216,12 +217,12 @@ Files in this distribution:
makefile.openbsd => OpenBSD makefile
makefile.sgi => Silicon Graphics IRIX (cc, creates static lib)
makefile.sggcc => Silicon Graphics
(gcc, creates libpng12.so.0.1.2.16)
(gcc, creates libpng12.so.0.1.2.25)
makefile.sunos => Sun makefile
makefile.solaris => Solaris 2.X makefile
(gcc, creates libpng12.so.0.1.2.16)
(gcc, creates libpng12.so.0.1.2.25)
makefile.so9 => Solaris 9 makefile
(gcc, creates libpng12.so.0.1.2.16)
(gcc, creates libpng12.so.0.1.2.25)
makefile.32sunu => Sun Ultra 32-bit makefile
makefile.64sunu => Sun Ultra 64-bit makefile
makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc
......@@ -256,7 +257,7 @@ Good luck, and happy coding.
-Andreas Eric Dilger (former maintainer, 1996-1997)
Internet: adilger at enel.ucalgary.ca
Web: http://www-mddsp.enel.ucalgary.ca/People/adilger/
Web: http://members.shaw.ca/adilger/
-Guy Eric Schalnat (original author and former maintainer, 1995-1996)
(formerly of Group 42, Inc)
......
Y2K compliance in libpng:
=========================
January 31, 2007
February 18, 2008
Since the PNG Development group is an ad-hoc body, we can't make
an official declaration.
This is your unofficial assurance that libpng from version 0.71 and
upward through 1.2.16 are Y2K compliant. It is my belief that earlier
upward through 1.2.25 are Y2K compliant. It is my belief that earlier
versions were also Y2K compliant.
Libpng only has three year fields. One is a 2-byte unsigned integer
......
This diff is collapsed.
libpng.txt - A description on how to use and modify libpng
libpng version 1.2.16 - January 31, 2007
libpng version 1.2.24 - December 14, 2007
Updated and distributed by Glenn Randers-Pehrson
<glennrp at users.sourceforge.net>
Copyright (c) 1998-2005 Glenn Randers-Pehrson
Copyright (c) 1998-2007 Glenn Randers-Pehrson
For conditions of distribution and use, see copyright
notice in png.h.
......@@ -33,6 +33,10 @@ it is heavily commented and should include everything most people
will need. We assume that libpng is already installed; see the
INSTALL file for instructions on how to install libpng.
For examples of libpng usage, see the files "example.c", "pngtest.c",
and the files in the "contrib" directory, all of which are included in the
libpng distribution.
Libpng was written as a companion to the PNG specification, as a way
of reducing the amount of time and effort it takes to support the PNG
file format in application programs.
......@@ -82,9 +86,7 @@ Libpng is thread safe, provided the threads are using different
instances of the structures. Each thread should have its own
png_struct and png_info instances, and thus its own image.
Libpng does not protect itself against two threads using the
same instance of a structure. Note: thread safety may be defeated
by use of some of the MMX assembler code in pnggccrd.c, which is only
compiled when the user defines PNG_THREAD_UNSAFE_OK.
same instance of a structure.
II. Structures
......@@ -2351,17 +2353,13 @@ For a more compact example of writing a PNG image, see the file example.c.
V. Modifying/Customizing libpng:
There are three issues here. The first is changing how libpng does
There are two issues here. The first is changing how libpng does
standard things like memory allocation, input/output, and error handling.
The second deals with more complicated things like adding new chunks,
adding new transformations, and generally changing how libpng works.
Both of those are compile-time issues; that is, they are generally
determined at the time the code is written, and there is rarely a need
to provide the user with a means of changing them. The third is a
run-time issue: choosing between and/or tuning one or more alternate
versions of computationally intensive routines; specifically, optimized
assembly-language (and therefore compiler- and platform-dependent)
versions.
to provide the user with a means of changing them.
Memory allocation, input/output, and error handling
......@@ -2722,125 +2720,6 @@ When PNG_DEBUG = 1, the macros are defined, but only png_debug statements
having level = 0 will be printed. There aren't any such statements in
this version of libpng, but if you insert some they will be printed.
VI. Runtime optimization
A new feature in libpng 1.2.0 is the ability to dynamically switch between
standard and optimized versions of some routines. Currently these are
limited to three computationally intensive tasks when reading PNG files:
decoding row filters, expanding interlacing, and combining interlaced or
transparent row data with previous row data. Currently the optimized
versions are available only for x86 (Intel, AMD, etc.) platforms with
MMX support, though this may change in future versions. (For example,
the non-MMX assembler optimizations for zlib might become similarly
runtime-selectable in future releases, in which case libpng could be
extended to support them. Alternatively, the compile-time choice of
floating-point versus integer routines for gamma correction might become
runtime-selectable.)
Because such optimizations tend to be very platform- and compiler-dependent,
both in how they are written and in how they perform, the new runtime code
in libpng has been written to allow programs to query, enable, and disable
either specific optimizations or all such optimizations. For example, to
enable all possible optimizations (bearing in mind that some "optimizations"
may actually run more slowly in rare cases):
#if defined(PNG_LIBPNG_VER) && (PNG_LIBPNG_VER >= 10200)
png_uint_32 mask, flags;
flags = png_get_asm_flags(png_ptr);
mask = png_get_asm_flagmask(PNG_SELECT_READ | PNG_SELECT_WRITE);
png_set_asm_flags(png_ptr, flags | mask);
#endif
To enable only optimizations relevant to reading PNGs, use PNG_SELECT_READ
by itself when calling png_get_asm_flagmask(); similarly for optimizing
only writing. To disable all optimizations:
#if defined(PNG_LIBPNG_VER) && (PNG_LIBPNG_VER >= 10200)
flags = png_get_asm_flags(png_ptr);
mask = png_get_asm_flagmask(PNG_SELECT_READ | PNG_SELECT_WRITE);
png_set_asm_flags(png_ptr, flags & ~mask);
#endif
To enable or disable only MMX-related features, use png_get_mmx_flagmask()
in place of png_get_asm_flagmask(). The mmx version takes one additional
parameter:
#if defined(PNG_LIBPNG_VER) && (PNG_LIBPNG_VER >= 10200)
int selection = PNG_SELECT_READ | PNG_SELECT_WRITE;
int compilerID;
mask = png_get_mmx_flagmask(selection, &compilerID);
#endif
On return, compilerID will indicate which version of the MMX assembler
optimizations was compiled. Currently two flavors exist: Microsoft
Visual C++ (compilerID == 1) and GNU C (a.k.a. gcc/gas, compilerID == 2).
On non-x86 platforms or on systems compiled without MMX optimizations, a
value of -1 is used.
Note that both png_get_asm_flagmask() and png_get_mmx_flagmask() return
all valid, settable optimization bits for the version of the library that's
currently in use. In the case of shared (dynamically linked) libraries,
this may include optimizations that did not exist at the time the code was
written and compiled. It is also possible, of course, to enable only known,
specific optimizations; for example:
#if defined(PNG_LIBPNG_VER) && (PNG_LIBPNG_VER >= 10200)
flags = PNG_ASM_FLAG_MMX_READ_COMBINE_ROW \
| PNG_ASM_FLAG_MMX_READ_INTERLACE \
| PNG_ASM_FLAG_MMX_READ_FILTER_SUB \
| PNG_ASM_FLAG_MMX_READ_FILTER_UP \
| PNG_ASM_FLAG_MMX_READ_FILTER_AVG \
| PNG_ASM_FLAG_MMX_READ_FILTER_PAETH ;
png_set_asm_flags(png_ptr, flags);
#endif
This method would enable only the MMX read-optimizations available at the
time of libpng 1.2.0's release, regardless of whether a later version of
the DLL were actually being used. (Also note that these functions did not
exist in versions older than 1.2.0, so any attempt to run a dynamically
linked app on such an older version would fail.)
To determine whether the processor supports MMX instructions at all, use
the png_mmx_support() function:
#if defined(PNG_LIBPNG_VER) && (PNG_LIBPNG_VER >= 10200)
mmxsupport = png_mmx_support();
#endif
It returns -1 if MMX support is not compiled into libpng, 0 if MMX code
is compiled but MMX is not supported by the processor, or 1 if MMX support
is fully available. Note that png_mmx_support(), png_get_mmx_flagmask(),
and png_get_asm_flagmask() all may be called without allocating and ini-
tializing any PNG structures (for example, as part of a usage screen or
"about" box).
The following code can be used to prevent an application from using the
thread_unsafe features, even if libpng was built with PNG_THREAD_UNSAFE_OK
defined:
#if defined(PNG_USE_PNGGCCRD) && defined(PNG_ASSEMBLER_CODE_SUPPORTED) \
&& defined(PNG_THREAD_UNSAFE_OK)
/* Disable thread-unsafe features of pnggccrd */
if (png_access_version_number() >= 10200)
{
png_uint_32 mmx_disable_mask = 0;
png_uint_32 asm_flags;
mmx_disable_mask |= ( PNG_ASM_FLAG_MMX_READ_COMBINE_ROW \
| PNG_ASM_FLAG_MMX_READ_FILTER_SUB \
| PNG_ASM_FLAG_MMX_READ_FILTER_AVG \
| PNG_ASM_FLAG_MMX_READ_FILTER_PAETH );
asm_flags = png_get_asm_flags(png_ptr);
png_set_asm_flags(png_ptr, asm_flags & ~mmx_disable_mask);
}
#endif
For more extensive examples of runtime querying, enabling and disabling
of optimized features, see contrib/gregbook/readpng2.c in the libpng
source-code distribution.
VII. MNG support
The MNG specification (available at http://www.libpng.org/pub/mng) allows
......@@ -2917,13 +2796,13 @@ application:
IX. Y2K Compliance in libpng
January 31, 2007
December 14, 2007
Since the PNG Development group is an ad-hoc body, we can't make
an official declaration.
This is your unofficial assurance that libpng from version 0.71 and
upward through 1.2.16 are Y2K compliant. It is my belief that earlier
upward through 1.2.24 are Y2K compliant. It is my belief that earlier
versions were also Y2K compliant.
Libpng only has three year fields. One is a 2-byte unsigned integer that
......
.TH LIBPNGPF 3 "January 31, 2007"
.TH LIBPNGPF 3 "February 18, 2008"
.SH NAME
libpng \- Portable Network Graphics (PNG) Reference Library 1.2.16
libpng \- Portable Network Graphics (PNG) Reference Library 1.2.25
(private functions)
.SH SYNOPSIS
\fB#include <png.h>\fP
......@@ -269,6 +269,6 @@ are listed alphabetically here as an aid to libpng maintainers.
See png.h for more information on these functions.
.SH SEE ALSO
libpng(3), png(5)
.IR libpng(3) ", " png(5)
.SH AUTHOR
Glenn Randers-Pehrson
.TH PNG 5 "January 31, 2007"
.TH PNG 5 "February 18, 2008"
.SH NAME
png \- Portable Network Graphics (PNG) format
.SH DESCRIPTION
......@@ -18,7 +18,7 @@ gamma and chromaticity data for improved color matching on heterogeneous
platforms.
.SH "SEE ALSO"
.IR libpng(3), zlib(3), deflate(5), and zlib(5)
.IR libpng(3) ", " zlib(3) ", " deflate(5) ", and " zlib(5)
.LP
PNG specification (second edition), November 2003:
.IP
......
/* png.c - location for general purpose libpng functions
*
* Last changed in libpng 1.2.15 January 5, 2007
* Last changed in libpng 1.2.21 October 4, 2007
* For conditions of distribution and use, see copyright notice in png.h
* Copyright (c) 1998-2007 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
......@@ -13,20 +13,20 @@
#include "png.h"
/* Generate a compiler error if there is an old png.h in the search path. */
typedef version_1_2_16 Your_png_h_is_not_version_1_2_16;
typedef version_1_2_25 Your_png_h_is_not_version_1_2_25;
/* Version information for C files. This had better match the version
* string defined in png.h. */
#ifdef PNG_USE_GLOBAL_ARRAYS
/* png_libpng_ver was changed to a function in version 1.0.5c */
const char png_libpng_ver[18] = PNG_LIBPNG_VER_STRING;
PNG_CONST char png_libpng_ver[18] = PNG_LIBPNG_VER_STRING;
#ifdef PNG_READ_SUPPORTED
/* png_sig was changed to a function in version 1.0.5c */
/* Place to hold the signature string for a PNG file. */
const png_byte FARDATA png_sig[8] = {137, 80, 78, 71, 13, 10, 26, 10};
PNG_CONST png_byte FARDATA png_sig[8] = {137, 80, 78, 71, 13, 10, 26, 10};
#endif /* PNG_READ_SUPPORTED */