Toshihiro Shimizu 890ddd
README for libpng 1.2.4 - July 8, 2002 (shared library 12.0)
Toshihiro Shimizu 890ddd
See the note about version numbers near the top of png.h
Toshihiro Shimizu 890ddd

Toshihiro Shimizu 890ddd
See INSTALL for instructions on how to install libpng.
Toshihiro Shimizu 890ddd

Toshihiro Shimizu 890ddd
Libpng comes in two distribution formats.  Get libpng-*.tar.gz if you
Toshihiro Shimizu 890ddd
want UNIX-style line endings in the text files, or lpng*.zip if you want
Toshihiro Shimizu 890ddd
DOS-style line endings.
Toshihiro Shimizu 890ddd

Toshihiro Shimizu 890ddd
Version 0.89 was the first official release of libpng.  Don't let the
Toshihiro Shimizu 890ddd
fact that it's the first release fool you.  The libpng library has been in
Toshihiro Shimizu 890ddd
extensive use and testing since mid-1995.  By late 1997 it had
Toshihiro Shimizu 890ddd
finally gotten to the stage where there hadn't been significant
Toshihiro Shimizu 890ddd
changes to the API in some time, and people have a bad feeling about
Toshihiro Shimizu 890ddd
libraries with versions < 1.0.  Version 1.0.0 was released in
Toshihiro Shimizu 890ddd
March 1998.
Toshihiro Shimizu 890ddd

Toshihiro Shimizu 890ddd
****
Toshihiro Shimizu 890ddd
Note that some of the changes to the png_info structure render this
Toshihiro Shimizu 890ddd
version of the library binary incompatible with libpng-0.89 or
Toshihiro Shimizu 890ddd
earlier versions if you are using a shared library.  The type of the
Toshihiro Shimizu 890ddd
"filler" parameter for png_set_filler() has changed from png_byte to
Toshihiro Shimizu 890ddd
png_uint_32, which will affect shared-library applications that use
Toshihiro Shimizu 890ddd
this function.
Toshihiro Shimizu 890ddd

Toshihiro Shimizu 890ddd
To avoid problems with changes to the internals of png_info_struct,
Toshihiro Shimizu 890ddd
new APIs have been made available in 0.95 to avoid direct application
Toshihiro Shimizu 890ddd
access to info_ptr.  These functions are the png_set_<chunk> and
</chunk>
Toshihiro Shimizu 890ddd
png_get_<chunk> functions.  These functions should be used when
</chunk>
Toshihiro Shimizu 890ddd
accessing/storing the info_struct data, rather than manipulating it
Toshihiro Shimizu 890ddd
directly, to avoid such problems in the future.
Toshihiro Shimizu 890ddd

Toshihiro Shimizu 890ddd
It is important to note that the APIs do not make current programs
Toshihiro Shimizu 890ddd
that access the info struct directly incompatible with the new
Toshihiro Shimizu 890ddd
library.  However, it is strongly suggested that new programs use
Toshihiro Shimizu 890ddd
the new APIs (as shown in example.c and pngtest.c), and older programs
Toshihiro Shimizu 890ddd
be converted to the new format, to facilitate upgrades in the future.
Toshihiro Shimizu 890ddd
****
Toshihiro Shimizu 890ddd

Toshihiro Shimizu 890ddd
Additions since 0.90 include the ability to compile libpng as a
Toshihiro Shimizu 890ddd
Windows DLL, and new APIs for accessing data in the info struct.
Toshihiro Shimizu 890ddd
Experimental functions include the ability to set weighting and cost
Toshihiro Shimizu 890ddd
factors for row filter selection, direct reads of integers from buffers
Toshihiro Shimizu 890ddd
on big-endian processors that support misaligned data access, faster
Toshihiro Shimizu 890ddd
methods of doing alpha composition, and more accurate 16->8 bit color
Toshihiro Shimizu 890ddd
conversion.
Toshihiro Shimizu 890ddd

Toshihiro Shimizu 890ddd
The additions since 0.89 include the ability to read from a PNG stream
Toshihiro Shimizu 890ddd
which has had some (or all) of the signature bytes read by the calling
Toshihiro Shimizu 890ddd
application.  This also allows the reading of embedded PNG streams that
Toshihiro Shimizu 890ddd
do not have the PNG file signature.  As well, it is now possible to set
Toshihiro Shimizu 890ddd
the library action on the detection of chunk CRC errors.  It is possible
Toshihiro Shimizu 890ddd
to set different actions based on whether the CRC error occurred in a
Toshihiro Shimizu 890ddd
critical or an ancillary chunk.
Toshihiro Shimizu 890ddd

Toshihiro Shimizu 890ddd
The changes made to the library, and bugs fixed are based on discussions
Toshihiro Shimizu 890ddd
on the PNG implementation mailing list <png-implement@ccrc.wustl.edu>
</png-implement@ccrc.wustl.edu>
Toshihiro Shimizu 890ddd
and not on material submitted privately to Guy, Andreas, or Glenn.  They will
Toshihiro Shimizu 890ddd
forward any good suggestions to the list.
Toshihiro Shimizu 890ddd

Toshihiro Shimizu 890ddd
For a detailed description on using libpng, read libpng.txt.  For
Toshihiro Shimizu 890ddd
examples of libpng in a program, see example.c and pngtest.c.  For usage
Toshihiro Shimizu 890ddd
information and restrictions (what little they are) on libpng, see
Toshihiro Shimizu 890ddd
png.h.  For a description on using zlib (the compression library used by
Toshihiro Shimizu 890ddd
libpng) and zlib's restrictions, see zlib.h
Toshihiro Shimizu 890ddd

Toshihiro Shimizu 890ddd
I have included a general makefile, as well as several machine and
Toshihiro Shimizu 890ddd
compiler specific ones, but you may have to modify one for your own needs.
Toshihiro Shimizu 890ddd

Toshihiro Shimizu 890ddd
You should use zlib 1.0.4 or later to run this, but it MAY work with
Toshihiro Shimizu 890ddd
versions as old as zlib 0.95.  Even so, there are bugs in older zlib
Toshihiro Shimizu 890ddd
versions which can cause the output of invalid compression streams for
Toshihiro Shimizu 890ddd
some images.  You will definitely need zlib 1.0.4 or later if you are
Toshihiro Shimizu 890ddd
taking advantage of the MS-DOS "far" structure allocation for the small
Toshihiro Shimizu 890ddd
and medium memory models.  You should also note that zlib is a
Toshihiro Shimizu 890ddd
compression library that is useful for more things than just PNG files.
Toshihiro Shimizu 890ddd
You can use zlib as a drop-in replacement for fread() and fwrite() if
Toshihiro Shimizu 890ddd
you are so inclined.
Toshihiro Shimizu 890ddd

Toshihiro Shimizu 890ddd
zlib should be available at the same place that libpng is.
Toshihiro Shimizu 890ddd
If not, it should be at ftp.uu.net in /graphics/png
Toshihiro Shimizu 890ddd
Eventually, it will be at ftp.uu.net in /pub/archiving/zip/zlib
Toshihiro Shimizu 890ddd

Toshihiro Shimizu 890ddd
You may also want a copy of the PNG specification.  It is available
Toshihiro Shimizu 890ddd
as an RFC and a W3C Recommendation.  Failing
Toshihiro Shimizu 890ddd
these resources you can try ftp.uu.net in the /graphics/png directory.
Toshihiro Shimizu 890ddd

Toshihiro Shimizu 890ddd
This code is currently being archived at ftp.uu.net in the
Toshihiro Shimizu 890ddd
/graphics/png directory, and on CompuServe, Lib 20 (PNG SUPPORT)
Toshihiro Shimizu 890ddd
at GO GRAPHSUP.  If you can't find it in any of those places,
Toshihiro Shimizu 890ddd
e-mail me, and I'll help you find it.
Toshihiro Shimizu 890ddd

Toshihiro Shimizu 890ddd
If you have any code changes, requests, problems, etc., please e-mail
Toshihiro Shimizu 890ddd
them to me.  Also, I'd appreciate any make files or project files,
Toshihiro Shimizu 890ddd
and any modifications you needed to make to get libpng to compile,
Toshihiro Shimizu 890ddd
along with a #define variable to tell what compiler/system you are on.
Toshihiro Shimizu 890ddd
If you needed to add transformations to libpng, or wish libpng would
Toshihiro Shimizu 890ddd
provide the image in a different way, drop me a note (and code, if
Toshihiro Shimizu 890ddd
possible), so I can consider supporting the transformation.
Toshihiro Shimizu 890ddd
Finally, if you get any warning messages when compiling libpng
Toshihiro Shimizu 890ddd
(note: not zlib), and they are easy to fix, I'd appreciate the
Toshihiro Shimizu 890ddd
fix.  Please mention "libpng" somewhere in the subject line.  Thanks.
Toshihiro Shimizu 890ddd

Toshihiro Shimizu 890ddd
This release was created and will be supported by myself (of course
Toshihiro Shimizu 890ddd
based in a large way on Guy's and Andreas' earlier work), and the PNG group.
Toshihiro Shimizu 890ddd

Toshihiro Shimizu 890ddd
randeg@alum.rpi.edu
Toshihiro Shimizu 890ddd
png-implement@ccrc.wustl.edu
Toshihiro Shimizu 890ddd

Toshihiro Shimizu 890ddd
You can't reach Guy, the original libpng author, at the addresses
Toshihiro Shimizu 890ddd
given in previous versions of this document.  He and Andreas will read mail
Toshihiro Shimizu 890ddd
addressed to the png-implement list, however.
Toshihiro Shimizu 890ddd

Toshihiro Shimizu 890ddd
Please do not send general questions about PNG.  Send them to
Toshihiro Shimizu 890ddd
the address in the specification (png-group@w3.org).  At the same
Toshihiro Shimizu 890ddd
time, please do not send libpng questions to that address, send them to me
Toshihiro Shimizu 890ddd
or to png-implement@ccrc.wustl.edu.  I'll
Toshihiro Shimizu 890ddd
get them in the end anyway.  If you have a question about something
Toshihiro Shimizu 890ddd
in the PNG specification that is related to using libpng, send it
Toshihiro Shimizu 890ddd
to me.  Send me any questions that start with "I was using libpng,
Toshihiro Shimizu 890ddd
and ...".  If in doubt, send questions to me.  I'll bounce them
Toshihiro Shimizu 890ddd
to others, if necessary.
Toshihiro Shimizu 890ddd

Toshihiro Shimizu 890ddd
Please do not send suggestions on how to change PNG.  We have
Toshihiro Shimizu 890ddd
been discussing PNG for three years now, and it is official and
Toshihiro Shimizu 890ddd
finished.  If you have suggestions for libpng, however, I'll
Toshihiro Shimizu 890ddd
gladly listen.  Even if your suggestion is not used for version
Toshihiro Shimizu 890ddd
1.0, it may be used later.
Toshihiro Shimizu 890ddd

Toshihiro Shimizu 890ddd
Files in this distribution:
Toshihiro Shimizu 890ddd

Toshihiro Shimizu 890ddd
      ANNOUNCE      =>  Announcement of this version, with recent changes
Toshihiro Shimizu 890ddd
      CHANGES       =>  Description of changes between libpng versions
Toshihiro Shimizu 890ddd
      KNOWNBUG      =>  List of known bugs and deficiencies
Toshihiro Shimizu 890ddd
      LICENSE       =>  License to use and redistribute libpng
Toshihiro Shimizu 890ddd
      README        =>  This file
Toshihiro Shimizu 890ddd
      TODO          =>  Things not implemented in the current library
Toshihiro Shimizu 890ddd
      Y2KINFO       =>  Statement of Y2K compliance
Toshihiro Shimizu 890ddd
      example.c     =>  Example code for using libpng functions
Toshihiro Shimizu 890ddd
      libpng.3      =>  manual page for libpng (includes libpng.txt)
Toshihiro Shimizu 890ddd
      libpng.txt    =>  Description of libpng and its functions
Toshihiro Shimizu 890ddd
      libpngpf.3    =>  manual page for libpng's private functions
Toshihiro Shimizu 890ddd
      png.5         =>  manual page for the PNG format
Toshihiro Shimizu 890ddd
      png.c         =>  Basic interface functions common to library
Toshihiro Shimizu 890ddd
      png.h         =>  Library function and interface declarations
Toshihiro Shimizu 890ddd
      pngconf.h     =>  System specific library configuration
Toshihiro Shimizu 890ddd
      pngasmrd.h    =>  Header file for assembler-coded functions
Toshihiro Shimizu 890ddd
      pngerror.c    =>  Error/warning message I/O functions
Toshihiro Shimizu 890ddd
      pngget.c      =>  Functions for retrieving info from struct
Toshihiro Shimizu 890ddd
      pngmem.c      =>  Memory handling functions
Toshihiro Shimizu 890ddd
      pngbar.png    =>  PNG logo, 88x31
Toshihiro Shimizu 890ddd
      pngnow.png    =>  PNG logo, 98x31
Toshihiro Shimizu 890ddd
      pngpread.c    =>  Progressive reading functions
Toshihiro Shimizu 890ddd
      pngread.c     =>  Read data/helper high-level functions
Toshihiro Shimizu 890ddd
      pngrio.c      =>  Lowest-level data read I/O functions
Toshihiro Shimizu 890ddd
      pngrtran.c    =>  Read data transformation functions
Toshihiro Shimizu 890ddd
      pngrutil.c    =>  Read data utility functions
Toshihiro Shimizu 890ddd
      pngset.c      =>  Functions for storing data into the info_struct
Toshihiro Shimizu 890ddd
      pngtest.c     =>  Library test program
Toshihiro Shimizu 890ddd
      pngtest.png   =>  Library test sample image
Toshihiro Shimizu 890ddd
      pngtrans.c    =>  Common data transformation functions
Toshihiro Shimizu 890ddd
      pngwio.c      =>  Lowest-level write I/O functions
Toshihiro Shimizu 890ddd
      pngwrite.c    =>  High-level write functions
Toshihiro Shimizu 890ddd
      pngwtran.c    =>  Write data transformations
Toshihiro Shimizu 890ddd
      pngwutil.c    =>  Write utility functions
Toshihiro Shimizu 890ddd
      contrib       =>  Contributions
Toshihiro Shimizu 890ddd
       gregbook         =>  source code for PNG reading and writing, from
Toshihiro Shimizu 890ddd
                            Greg Roelofs' "PNG: The Definitive Guide",
Toshihiro Shimizu 890ddd
                            O'Reilly, 1999
Toshihiro Shimizu 890ddd
       msvctest     =>  Builds and runs pngtest using a MSVC workspace
Toshihiro Shimizu 890ddd
       pngminus     =>  Simple pnm2png and png2pnm programs
Toshihiro Shimizu 890ddd
       pngsuite     =>  Test images
Toshihiro Shimizu 890ddd
       visupng      =>  Contains a MSVC workspace for VisualPng
Toshihiro Shimizu 890ddd
      projects      =>  Contains project files and workspaces for building DLL
Toshihiro Shimizu 890ddd
       beos             =>  Contains a Beos workspace for building libpng
Toshihiro Shimizu 890ddd
       borland          =>  Contains a Borland workspace for building libpng
Toshihiro Shimizu 890ddd
                            and zlib
Toshihiro Shimizu 890ddd
       msvc             =>  Contains a Microsoft Visual C++ (MSVC) workspace
Toshihiro Shimizu 890ddd
                            for building libpng and zlib
Toshihiro Shimizu 890ddd
       netware.txt      =>  Contains instructions for downloading a set of
Toshihiro Shimizu 890ddd
                            project files for building libpng and zlib on
Toshihiro Shimizu 890ddd
                            Netware.
Toshihiro Shimizu 890ddd
       wince.txt        =>  Contains instructions for downloading a Microsoft
Toshihiro Shimizu 890ddd
                            Visual C++ (Windows CD Toolkit) workspace for
Toshihiro Shimizu 890ddd
                            building libpng and zlib on WindowsCE
Toshihiro Shimizu 890ddd
      scripts       =>  Directory containing scripts for building libpng:
Toshihiro Shimizu 890ddd
       descrip.mms      =>  VMS makefile for MMS or MMK
Toshihiro Shimizu 890ddd
       makefile.std     =>  Generic UNIX makefile (cc, creates static libpng.a)
Toshihiro Shimizu 890ddd
       makefile.linux   =>  Linux/ELF makefile
Toshihiro Shimizu 890ddd
                            (gcc, creates libpng12.so.0.1.2.4)
Toshihiro Shimizu 890ddd
       makefile.gcmmx   =>  Linux/ELF makefile (gcc, creates
Toshihiro Shimizu 890ddd
                            libpng12.so.0.1.2.4, uses assembler code
Toshihiro Shimizu 890ddd
                            tuned for Intel MMX platform)
Toshihiro Shimizu 890ddd
       makefile.gcc     =>  Generic makefile (gcc, creates static libpng.a)
Toshihiro Shimizu 890ddd
       makefile.knr     =>  Archaic UNIX Makefile that converts files with
Toshihiro Shimizu 890ddd
                            ansi2knr (Requires ansi2knr.c from
Toshihiro Shimizu 890ddd
                            ftp://ftp.cs.wisc.edu/ghost)
Toshihiro Shimizu 890ddd
       makefile.aix     =>  AIX makefile
Toshihiro Shimizu 890ddd
       makefile.cygwin  =>  Cygwin/gcc makefile
Toshihiro Shimizu 890ddd
       makefile.darwin  =>  Darwin makefile
Toshihiro Shimizu 890ddd
       makefile.dec     =>  DEC Alpha UNIX makefile
Toshihiro Shimizu 890ddd
       makefile.freebsd =>  FreeBSD makefile
Toshihiro Shimizu 890ddd
       makefile.hpgcc   =>  HPUX makefile using gcc
Toshihiro Shimizu 890ddd
       makefile.hpux    =>  HPUX (10.20 and 11.00) makefile
Toshihiro Shimizu 890ddd
       makefile.ibmc    =>  IBM C/C++ version 3.x for Win32 and OS/2 (static)
Toshihiro Shimizu 890ddd
       makefile.intel   =>  Intel C/C++ version 4.0 and later
Toshihiro Shimizu 890ddd
       libpng.icc       =>  Project file, IBM VisualAge/C++ 4.0 or later
Toshihiro Shimizu 890ddd
       makefile.macosx  =>  MACOS X Makefile
Toshihiro Shimizu 890ddd
       makefile.netbsd  =>  NetBSD/cc makefile, PNGGCCRD, makes libpng.so.
Toshihiro Shimizu 890ddd
       makefile.ne0bsd =>  NetBSD/cc makefile, PNGGCCRD, makes libpng0.so
Toshihiro Shimizu 890ddd
       makefile.openbsd =>  OpenBSD makefile
Toshihiro Shimizu 890ddd
       makefile.sgi     =>  Silicon Graphics IRIX (cc, creates static lib)
Toshihiro Shimizu 890ddd
       makefile.sggcc   =>  Silicon Graphics (gcc, creates libpng12.so.0.1.2.4)
Toshihiro Shimizu 890ddd
       makefile.sunos   =>  Sun makefile
Toshihiro Shimizu 890ddd
       makefile.solaris =>  Solaris 2.X makefile
Toshihiro Shimizu 890ddd
                            (gcc, creates libpng12.so.0.1.2.4)
Toshihiro Shimizu 890ddd
       makefile.so9     =>  Solaris 9 makefile
Toshihiro Shimizu 890ddd
                            (gcc, creates libpng12.so.0.1.2.4)
Toshihiro Shimizu 890ddd
       makefile.32sunu  =>  Sun Ultra 32-bit makefile
Toshihiro Shimizu 890ddd
       makefile.64sunu  =>  Sun Ultra 64-bit makefile
Toshihiro Shimizu 890ddd
       makefile.sco     =>  For SCO OSr5  ELF and Unixware 7 with Native cc
Toshihiro Shimizu 890ddd
       makefile.mips    =>  MIPS makefile
Toshihiro Shimizu 890ddd
       makefile.acorn   =>  Acorn makefile
Toshihiro Shimizu 890ddd
       makefile.amiga   =>  Amiga makefile
Toshihiro Shimizu 890ddd
       smakefile.ppc    =>  AMIGA smakefile for SAS C V6.58/7.00 PPC
Toshihiro Shimizu 890ddd
                            compiler (Requires SCOPTIONS, copied from
Toshihiro Shimizu 890ddd
                            scripts/SCOPTIONS.ppc)
Toshihiro Shimizu 890ddd
       makefile.atari   =>  Atari makefile
Toshihiro Shimizu 890ddd
       makefile.beos    =>  BEOS makefile for X86
Toshihiro Shimizu 890ddd
       makefile.bor     =>  Borland makefile (uses bcc)
Toshihiro Shimizu 890ddd
       makefile.bc32    =>  32-bit Borland C++ (all modules compiled in C mode)
Toshihiro Shimizu 890ddd
       makefile.bd32    =>  To make a png32bd.dll with Borland C++ 4.5
Toshihiro Shimizu 890ddd
       makefile.tc3     =>  Turbo C 3.0 makefile
Toshihiro Shimizu 890ddd
       makefile.dj2     =>  DJGPP 2 makefile
Toshihiro Shimizu 890ddd
       makefile.msc     =>  Microsoft C makefile
Toshihiro Shimizu 890ddd
       makefile.vcawin32 => makefile for Microsoft Visual C++ 5.0 and
Toshihiro Shimizu 890ddd
                            later (uses assembler code tuned for Intel MMX
Toshihiro Shimizu 890ddd
                            platform)
Toshihiro Shimizu 890ddd
       makefile.vcwin32 =>  makefile for Microsoft Visual C++ 4.0 and
Toshihiro Shimizu 890ddd
                            later (does not use assembler code)
Toshihiro Shimizu 890ddd
       makefile.os2     =>  OS/2 Makefile (gcc and emx, requires pngos2.def)
Toshihiro Shimizu 890ddd
       pngos2.def       =>  OS/2 module definition file used by makefile.os2
Toshihiro Shimizu 890ddd
       makefile.watcom  =>  Watcom 10a+ Makefile, 32-bit flat memory model
Toshihiro Shimizu 890ddd
       makevms.com      =>  VMS build script
Toshihiro Shimizu 890ddd
       pngdef.pas       =>  Defines for a png32bd.dll with Borland C++ 4.5
Toshihiro Shimizu 890ddd
       SCOPTIONS.ppc    =>  Used with smakefile.ppc
Toshihiro Shimizu 890ddd
      mangle        =>  Directory containing scripts to build libpng12m.so:
Toshihiro Shimizu 890ddd
       mangle.in        =>  Function-decoration macros added to png.h by the
Toshihiro Shimizu 890ddd
                            makefiles.
Toshihiro Shimizu 890ddd
       makefile.linux   =>  Linux/ELF makefile
Toshihiro Shimizu 890ddd
                            (gcc, creates libpng12m.so.0.1.2.4)
Toshihiro Shimizu 890ddd
       makefile.gcmmx   =>  Linux/ELF makefile (gcc, creates
Toshihiro Shimizu 890ddd
                            libpng12.so.0m.1.2.4, uses assembler code
Toshihiro Shimizu 890ddd
                            tuned for Intel MMX platform)
Toshihiro Shimizu 890ddd
       makefile.sgi     =>  Silicon Graphics (cc, creates libpng12m.so)
Toshihiro Shimizu 890ddd
       makefile.sggcc   =>  Silicon Graphics (gcc, creates libpng12m.so)
Toshihiro Shimizu 890ddd

Toshihiro Shimizu 890ddd
Good luck, and happy coding.
Toshihiro Shimizu 890ddd

Toshihiro Shimizu 890ddd
-Glenn Randers-Pehrson
Toshihiro Shimizu 890ddd
 Internet: randeg@alum.rpi.edu
Toshihiro Shimizu 890ddd

Toshihiro Shimizu 890ddd
-Andreas Eric Dilger
Toshihiro Shimizu 890ddd
 Internet: adilger@enel.ucalgary.ca
Toshihiro Shimizu 890ddd
 Web: http://www-mddsp.enel.ucalgary.ca/People/adilger/
Toshihiro Shimizu 890ddd

Toshihiro Shimizu 890ddd
-Guy Eric Schalnat
Toshihiro Shimizu 890ddd
 (formerly of Group 42, Inc)
Toshihiro Shimizu 890ddd
 Internet: gschal@infinet.com