xref: /third_party/libpng/README (revision 5bec5421)
15bec5421Sopenharmony_ciREADME for libpng version 1.6.38
25bec5421Sopenharmony_ci================================
35bec5421Sopenharmony_ci
45bec5421Sopenharmony_ciSee the note about version numbers near the top of png.h.
55bec5421Sopenharmony_ciSee INSTALL for instructions on how to install libpng.
65bec5421Sopenharmony_ci
75bec5421Sopenharmony_ciLibpng comes in several distribution formats.  Get libpng-*.tar.gz or
85bec5421Sopenharmony_cilibpng-*.tar.xz if you want UNIX-style line endings in the text files,
95bec5421Sopenharmony_cior lpng*.7z or lpng*.zip if you want DOS-style line endings.
105bec5421Sopenharmony_ci
115bec5421Sopenharmony_ciVersion 0.89 was the first official release of libpng.  Don't let the
125bec5421Sopenharmony_cifact that it's the first release fool you.  The libpng library has been
135bec5421Sopenharmony_ciin extensive use and testing since mid-1995.  By late 1997 it had
145bec5421Sopenharmony_cifinally gotten to the stage where there hadn't been significant
155bec5421Sopenharmony_cichanges to the API in some time, and people have a bad feeling about
165bec5421Sopenharmony_cilibraries with versions < 1.0.  Version 1.0.0 was released in
175bec5421Sopenharmony_ciMarch 1998.
185bec5421Sopenharmony_ci
195bec5421Sopenharmony_ci****
205bec5421Sopenharmony_ciNote that some of the changes to the png_info structure render this
215bec5421Sopenharmony_civersion of the library binary incompatible with libpng-0.89 or
225bec5421Sopenharmony_ciearlier versions if you are using a shared library.  The type of the
235bec5421Sopenharmony_ci"filler" parameter for png_set_filler() has changed from png_byte to
245bec5421Sopenharmony_cipng_uint_32, which will affect shared-library applications that use
255bec5421Sopenharmony_cithis function.
265bec5421Sopenharmony_ci
275bec5421Sopenharmony_ciTo avoid problems with changes to the internals of the png info_struct,
285bec5421Sopenharmony_cinew APIs have been made available in 0.95 to avoid direct application
295bec5421Sopenharmony_ciaccess to info_ptr.  These functions are the png_set_<chunk> and
305bec5421Sopenharmony_cipng_get_<chunk> functions.  These functions should be used when
315bec5421Sopenharmony_ciaccessing/storing the info_struct data, rather than manipulating it
325bec5421Sopenharmony_cidirectly, to avoid such problems in the future.
335bec5421Sopenharmony_ci
345bec5421Sopenharmony_ciIt is important to note that the APIs did not make current programs
355bec5421Sopenharmony_cithat access the info struct directly incompatible with the new
365bec5421Sopenharmony_cilibrary, through libpng-1.2.x.  In libpng-1.4.x, which was meant to
375bec5421Sopenharmony_cibe a transitional release, members of the png_struct and the
385bec5421Sopenharmony_ciinfo_struct can still be accessed, but the compiler will issue a
395bec5421Sopenharmony_ciwarning about deprecated usage.  Since libpng-1.5.0, direct access
405bec5421Sopenharmony_cito these structs is not allowed, and the definitions of the structs
415bec5421Sopenharmony_cireside in private pngstruct.h and pnginfo.h header files that are not
425bec5421Sopenharmony_ciaccessible to applications.  It is strongly suggested that new
435bec5421Sopenharmony_ciprograms use the new APIs (as shown in example.c and pngtest.c), and
445bec5421Sopenharmony_ciolder programs be converted to the new format, to facilitate upgrades
455bec5421Sopenharmony_ciin the future.
465bec5421Sopenharmony_ci****
475bec5421Sopenharmony_ci
485bec5421Sopenharmony_ciAdditions since 0.90 include the ability to compile libpng as a
495bec5421Sopenharmony_ciWindows DLL, and new APIs for accessing data in the info struct.
505bec5421Sopenharmony_ciExperimental functions include the ability to set weighting and cost
515bec5421Sopenharmony_cifactors for row filter selection, direct reads of integers from buffers
525bec5421Sopenharmony_cion big-endian processors that support misaligned data access, faster
535bec5421Sopenharmony_cimethods of doing alpha composition, and more accurate 16->8 bit color
545bec5421Sopenharmony_ciconversion.
555bec5421Sopenharmony_ci
565bec5421Sopenharmony_ciThe additions since 0.89 include the ability to read from a PNG stream
575bec5421Sopenharmony_ciwhich has had some (or all) of the signature bytes read by the calling
585bec5421Sopenharmony_ciapplication.  This also allows the reading of embedded PNG streams that
595bec5421Sopenharmony_cido not have the PNG file signature.  As well, it is now possible to set
605bec5421Sopenharmony_cithe library action on the detection of chunk CRC errors.  It is possible
615bec5421Sopenharmony_cito set different actions based on whether the CRC error occurred in a
625bec5421Sopenharmony_cicritical or an ancillary chunk.
635bec5421Sopenharmony_ci
645bec5421Sopenharmony_ciFor a detailed description on using libpng, read libpng-manual.txt.
655bec5421Sopenharmony_ciFor examples of libpng in a program, see example.c and pngtest.c.  For
665bec5421Sopenharmony_ciusage information and restrictions (what little they are) on libpng,
675bec5421Sopenharmony_cisee png.h.  For a description on using zlib (the compression library
685bec5421Sopenharmony_ciused by libpng) and zlib's restrictions, see zlib.h
695bec5421Sopenharmony_ci
705bec5421Sopenharmony_ciI have included a general makefile, as well as several machine and
715bec5421Sopenharmony_cicompiler specific ones, but you may have to modify one for your own
725bec5421Sopenharmony_cineeds.
735bec5421Sopenharmony_ci
745bec5421Sopenharmony_ciYou should use zlib 1.0.4 or later to run this, but it MAY work with
755bec5421Sopenharmony_civersions as old as zlib 0.95.  Even so, there are bugs in older zlib
765bec5421Sopenharmony_civersions which can cause the output of invalid compression streams for
775bec5421Sopenharmony_cisome images.
785bec5421Sopenharmony_ci
795bec5421Sopenharmony_ciYou should also note that zlib is a compression library that is useful
805bec5421Sopenharmony_cifor more things than just PNG files.  You can use zlib as a drop-in
815bec5421Sopenharmony_cireplacement for fread() and fwrite(), if you are so inclined.
825bec5421Sopenharmony_ci
835bec5421Sopenharmony_cizlib should be available at the same place that libpng is, or at
845bec5421Sopenharmony_cihttps://zlib.net.
855bec5421Sopenharmony_ci
865bec5421Sopenharmony_ciYou may also want a copy of the PNG specification.  It is available
875bec5421Sopenharmony_cias an RFC, a W3C Recommendation, and an ISO/IEC Standard.  You can find
885bec5421Sopenharmony_cithese at http://www.libpng.org/pub/png/pngdocs.html .
895bec5421Sopenharmony_ci
905bec5421Sopenharmony_ciThis code is currently being archived at libpng.sourceforge.io in the
915bec5421Sopenharmony_ci[DOWNLOAD] area, and at http://libpng.download/src .
925bec5421Sopenharmony_ci
935bec5421Sopenharmony_ciThis release, based in a large way on Glenn's, Guy's and Andreas'
945bec5421Sopenharmony_ciearlier work, was created and will be supported by myself and the PNG
955bec5421Sopenharmony_cidevelopment group.
965bec5421Sopenharmony_ci
975bec5421Sopenharmony_ciSend comments/corrections/commendations to png-mng-implement at
985bec5421Sopenharmony_cilists.sourceforge.net (subscription required; visit
995bec5421Sopenharmony_cihttps://lists.sourceforge.net/lists/listinfo/png-mng-implement
1005bec5421Sopenharmony_cito subscribe).
1015bec5421Sopenharmony_ci
1025bec5421Sopenharmony_ciSend general questions about the PNG specification to png-mng-misc
1035bec5421Sopenharmony_ciat lists.sourceforge.net (subscription required; visit
1045bec5421Sopenharmony_cihttps://lists.sourceforge.net/lists/listinfo/png-mng-misc to
1055bec5421Sopenharmony_cisubscribe).
1065bec5421Sopenharmony_ci
1075bec5421Sopenharmony_ciFiles in this distribution:
1085bec5421Sopenharmony_ci
1095bec5421Sopenharmony_ci      ANNOUNCE      =>  Announcement of this version, with recent changes
1105bec5421Sopenharmony_ci      AUTHORS       =>  List of contributing authors
1115bec5421Sopenharmony_ci      CHANGES       =>  Description of changes between libpng versions
1125bec5421Sopenharmony_ci      KNOWNBUG      =>  List of known bugs and deficiencies
1135bec5421Sopenharmony_ci      LICENSE       =>  License to use and redistribute libpng
1145bec5421Sopenharmony_ci      README        =>  This file
1155bec5421Sopenharmony_ci      TODO          =>  Things not implemented in the current library
1165bec5421Sopenharmony_ci      TRADEMARK     =>  Trademark information
1175bec5421Sopenharmony_ci      example.c     =>  Example code for using libpng functions
1185bec5421Sopenharmony_ci      libpng.3      =>  manual page for libpng (includes libpng-manual.txt)
1195bec5421Sopenharmony_ci      libpng-manual.txt  =>  Description of libpng and its functions
1205bec5421Sopenharmony_ci      libpngpf.3    =>  manual page for libpng's private functions
1215bec5421Sopenharmony_ci      png.5         =>  manual page for the PNG format
1225bec5421Sopenharmony_ci      png.c         =>  Basic interface functions common to library
1235bec5421Sopenharmony_ci      png.h         =>  Library function and interface declarations (public)
1245bec5421Sopenharmony_ci      pngpriv.h     =>  Library function and interface declarations (private)
1255bec5421Sopenharmony_ci      pngconf.h     =>  System specific library configuration (public)
1265bec5421Sopenharmony_ci      pngstruct.h   =>  png_struct declaration (private)
1275bec5421Sopenharmony_ci      pnginfo.h     =>  png_info struct declaration (private)
1285bec5421Sopenharmony_ci      pngdebug.h    =>  debugging macros (private)
1295bec5421Sopenharmony_ci      pngerror.c    =>  Error/warning message I/O functions
1305bec5421Sopenharmony_ci      pngget.c      =>  Functions for retrieving info from struct
1315bec5421Sopenharmony_ci      pngmem.c      =>  Memory handling functions
1325bec5421Sopenharmony_ci      pngbar.png    =>  PNG logo, 88x31
1335bec5421Sopenharmony_ci      pngnow.png    =>  PNG logo, 98x31
1345bec5421Sopenharmony_ci      pngpread.c    =>  Progressive reading functions
1355bec5421Sopenharmony_ci      pngread.c     =>  Read data/helper high-level functions
1365bec5421Sopenharmony_ci      pngrio.c      =>  Lowest-level data read I/O functions
1375bec5421Sopenharmony_ci      pngrtran.c    =>  Read data transformation functions
1385bec5421Sopenharmony_ci      pngrutil.c    =>  Read data utility functions
1395bec5421Sopenharmony_ci      pngset.c      =>  Functions for storing data into the info_struct
1405bec5421Sopenharmony_ci      pngtest.c     =>  Library test program
1415bec5421Sopenharmony_ci      pngtest.png   =>  Library test sample image
1425bec5421Sopenharmony_ci      pngtrans.c    =>  Common data transformation functions
1435bec5421Sopenharmony_ci      pngwio.c      =>  Lowest-level write I/O functions
1445bec5421Sopenharmony_ci      pngwrite.c    =>  High-level write functions
1455bec5421Sopenharmony_ci      pngwtran.c    =>  Write data transformations
1465bec5421Sopenharmony_ci      pngwutil.c    =>  Write utility functions
1475bec5421Sopenharmony_ci      arm           =>  Contains optimized code for the ARM platform
1485bec5421Sopenharmony_ci      powerpc       =>  Contains optimized code for the PowerPC platform
1495bec5421Sopenharmony_ci      contrib       =>  Contributions
1505bec5421Sopenharmony_ci       arm-neon         =>  Optimized code for ARM-NEON platform
1515bec5421Sopenharmony_ci       powerpc-vsx      =>  Optimized code for POWERPC-VSX platform
1525bec5421Sopenharmony_ci       examples         =>  Example programs
1535bec5421Sopenharmony_ci       gregbook         =>  source code for PNG reading and writing, from
1545bec5421Sopenharmony_ci                            Greg Roelofs' "PNG: The Definitive Guide",
1555bec5421Sopenharmony_ci                            O'Reilly, 1999
1565bec5421Sopenharmony_ci       libtests         =>  Test programs
1575bec5421Sopenharmony_ci       mips-msa         =>  Optimized code for MIPS-MSA platform
1585bec5421Sopenharmony_ci       pngminim         =>  Minimal decoder, encoder, and progressive decoder
1595bec5421Sopenharmony_ci                            programs demonstrating use of pngusr.dfa
1605bec5421Sopenharmony_ci       pngminus         =>  Simple pnm2png and png2pnm programs
1615bec5421Sopenharmony_ci       pngsuite         =>  Test images
1625bec5421Sopenharmony_ci       testpngs
1635bec5421Sopenharmony_ci       tools            =>  Various tools
1645bec5421Sopenharmony_ci       visupng          =>  Contains a MSVC workspace for VisualPng
1655bec5421Sopenharmony_ci      intel             =>  Optimized code for INTEL-SSE2 platform
1665bec5421Sopenharmony_ci      mips              =>  Optimized code for MIPS platform
1675bec5421Sopenharmony_ci      projects      =>  Contains project files and workspaces for
1685bec5421Sopenharmony_ci                        building a DLL
1695bec5421Sopenharmony_ci       owatcom          =>  Contains a WATCOM project for building libpng
1705bec5421Sopenharmony_ci       visualc71        =>  Contains a Microsoft Visual C++ (MSVC)
1715bec5421Sopenharmony_ci                            workspace for building libpng and zlib
1725bec5421Sopenharmony_ci       vstudio          =>  Contains a Microsoft Visual C++ (MSVC)
1735bec5421Sopenharmony_ci                            workspace for building libpng and zlib
1745bec5421Sopenharmony_ci      scripts       =>  Directory containing scripts for building libpng:
1755bec5421Sopenharmony_ci                            (see scripts/README.txt for the list of scripts)
1765bec5421Sopenharmony_ci
1775bec5421Sopenharmony_ciGood luck, and happy coding!
1785bec5421Sopenharmony_ci
1795bec5421Sopenharmony_ci * Cosmin Truta (current maintainer, since 2018)
1805bec5421Sopenharmony_ci * Glenn Randers-Pehrson (former maintainer, 1998-2018)
1815bec5421Sopenharmony_ci * Andreas Eric Dilger (former maintainer, 1996-1997)
1825bec5421Sopenharmony_ci * Guy Eric Schalnat (original author and former maintainer, 1995-1996)
1835bec5421Sopenharmony_ci   (formerly of Group 42, Inc.)
184