xref: /aosp_15_r20/external/libpng/README (revision a67afe4df73cf47866eedc69947994b8ff839aba)
1*a67afe4dSAndroid Build Coastguard WorkerREADME for libpng version 1.6.44
2*a67afe4dSAndroid Build Coastguard Worker================================
3*a67afe4dSAndroid Build Coastguard Worker
4*a67afe4dSAndroid Build Coastguard WorkerSee the note about version numbers near the top of `png.h`.
5*a67afe4dSAndroid Build Coastguard WorkerSee `INSTALL` for instructions on how to install libpng.
6*a67afe4dSAndroid Build Coastguard Worker
7*a67afe4dSAndroid Build Coastguard WorkerLibpng comes in several distribution formats.  Get `libpng-*.tar.gz`
8*a67afe4dSAndroid Build Coastguard Workeror `libpng-*.tar.xz` if you want UNIX-style line endings in the text
9*a67afe4dSAndroid Build Coastguard Workerfiles, or `lpng*.7z` or `lpng*.zip` if you want DOS-style line endings.
10*a67afe4dSAndroid Build Coastguard Worker
11*a67afe4dSAndroid Build Coastguard WorkerFor a detailed description on using libpng, read `libpng-manual.txt`.
12*a67afe4dSAndroid Build Coastguard WorkerFor examples of libpng in a program, see `example.c` and `pngtest.c`.
13*a67afe4dSAndroid Build Coastguard WorkerFor usage information and restrictions (what little they are) on libpng,
14*a67afe4dSAndroid Build Coastguard Workersee `png.h`.  For a description on using zlib (the compression library
15*a67afe4dSAndroid Build Coastguard Workerused by libpng) and zlib's restrictions, see `zlib.h`.
16*a67afe4dSAndroid Build Coastguard Worker
17*a67afe4dSAndroid Build Coastguard WorkerYou should use zlib 1.0.4 or later to run this, but it _may_ work with
18*a67afe4dSAndroid Build Coastguard Workerversions as old as zlib 0.95.  Even so, there are bugs in older zlib
19*a67afe4dSAndroid Build Coastguard Workerversions which can cause the output of invalid compression streams for
20*a67afe4dSAndroid Build Coastguard Workersome images.
21*a67afe4dSAndroid Build Coastguard Worker
22*a67afe4dSAndroid Build Coastguard WorkerYou should also note that zlib is a compression library that is useful
23*a67afe4dSAndroid Build Coastguard Workerfor more things than just PNG files.  You can use zlib as a drop-in
24*a67afe4dSAndroid Build Coastguard Workerreplacement for `fread()` and `fwrite()`, if you are so inclined.
25*a67afe4dSAndroid Build Coastguard Worker
26*a67afe4dSAndroid Build Coastguard Workerzlib should be available at the same place that libpng is, or at
27*a67afe4dSAndroid Build Coastguard Workerhttps://zlib.net .
28*a67afe4dSAndroid Build Coastguard Worker
29*a67afe4dSAndroid Build Coastguard WorkerYou may also want a copy of the PNG specification.  It is available
30*a67afe4dSAndroid Build Coastguard Workeras an RFC, a W3C Recommendation, and an ISO/IEC Standard.  You can find
31*a67afe4dSAndroid Build Coastguard Workerthese at http://www.libpng.org/pub/png/pngdocs.html .
32*a67afe4dSAndroid Build Coastguard Worker
33*a67afe4dSAndroid Build Coastguard WorkerThis code is currently being archived at https://libpng.sourceforge.io
34*a67afe4dSAndroid Build Coastguard Workerin the download area, and at http://libpng.download/src .
35*a67afe4dSAndroid Build Coastguard Worker
36*a67afe4dSAndroid Build Coastguard WorkerThis release, based in a large way on Glenn's, Guy's and Andreas'
37*a67afe4dSAndroid Build Coastguard Workerearlier work, was created and will be supported by myself and the PNG
38*a67afe4dSAndroid Build Coastguard Workerdevelopment group.
39*a67afe4dSAndroid Build Coastguard Worker
40*a67afe4dSAndroid Build Coastguard WorkerSend comments, corrections and commendations to `png-mng-implement`
41*a67afe4dSAndroid Build Coastguard Workerat `lists.sourceforge.net`.  (Subscription is required; visit
42*a67afe4dSAndroid Build Coastguard Workerhttps://lists.sourceforge.net/lists/listinfo/png-mng-implement
43*a67afe4dSAndroid Build Coastguard Workerto subscribe.)
44*a67afe4dSAndroid Build Coastguard Worker
45*a67afe4dSAndroid Build Coastguard WorkerSend general questions about the PNG specification to `png-mng-misc`
46*a67afe4dSAndroid Build Coastguard Workerat `lists.sourceforge.net`.  (Subscription is required; visit
47*a67afe4dSAndroid Build Coastguard Workerhttps://lists.sourceforge.net/lists/listinfo/png-mng-misc
48*a67afe4dSAndroid Build Coastguard Workerto subscribe.)
49*a67afe4dSAndroid Build Coastguard Worker
50*a67afe4dSAndroid Build Coastguard WorkerHistorical notes
51*a67afe4dSAndroid Build Coastguard Worker----------------
52*a67afe4dSAndroid Build Coastguard Worker
53*a67afe4dSAndroid Build Coastguard WorkerThe libpng library has been in extensive use and testing since mid-1995.
54*a67afe4dSAndroid Build Coastguard WorkerVersion 0.89, published a year later, was the first official release.
55*a67afe4dSAndroid Build Coastguard WorkerBy late 1997, it had finally gotten to the stage where there hadn't
56*a67afe4dSAndroid Build Coastguard Workerbeen significant changes to the API in some time, and people have a bad
57*a67afe4dSAndroid Build Coastguard Workerfeeling about libraries with versions below 1.0.  Version 1.0.0 was
58*a67afe4dSAndroid Build Coastguard Workerreleased in March 1998.
59*a67afe4dSAndroid Build Coastguard Worker
60*a67afe4dSAndroid Build Coastguard WorkerNote that some of the changes to the `png_info` structure render this
61*a67afe4dSAndroid Build Coastguard Workerversion of the library binary incompatible with libpng-0.89 or
62*a67afe4dSAndroid Build Coastguard Workerearlier versions if you are using a shared library.  The type of the
63*a67afe4dSAndroid Build Coastguard Worker`filler` parameter for `png_set_filler()` has changed from `png_byte`
64*a67afe4dSAndroid Build Coastguard Workerto `png_uint_32`, which will affect shared-library applications that
65*a67afe4dSAndroid Build Coastguard Workeruse this function.
66*a67afe4dSAndroid Build Coastguard Worker
67*a67afe4dSAndroid Build Coastguard WorkerTo avoid problems with changes to the internals of the `info_struct`,
68*a67afe4dSAndroid Build Coastguard Workernew APIs have been made available in 0.95 to avoid direct application
69*a67afe4dSAndroid Build Coastguard Workeraccess to `info_ptr`.  These functions are the `png_set_<chunk>` and
70*a67afe4dSAndroid Build Coastguard Worker`png_get_<chunk>` functions.  These functions should be used when
71*a67afe4dSAndroid Build Coastguard Workeraccessing/storing the `info_struct` data, rather than manipulating it
72*a67afe4dSAndroid Build Coastguard Workerdirectly, to avoid such problems in the future.
73*a67afe4dSAndroid Build Coastguard Worker
74*a67afe4dSAndroid Build Coastguard WorkerIt is important to note that the APIs did not make current programs
75*a67afe4dSAndroid Build Coastguard Workerthat access the info struct directly incompatible with the new
76*a67afe4dSAndroid Build Coastguard Workerlibrary, through libpng-1.2.x.  In libpng-1.4.x, which was meant to
77*a67afe4dSAndroid Build Coastguard Workerbe a transitional release, members of the `png_struct` and the
78*a67afe4dSAndroid Build Coastguard Worker`info_struct` can still be accessed, but the compiler will issue a
79*a67afe4dSAndroid Build Coastguard Workerwarning about deprecated usage.  Since libpng-1.5.0, direct access
80*a67afe4dSAndroid Build Coastguard Workerto these structs is not allowed, and the definitions of the structs
81*a67afe4dSAndroid Build Coastguard Workerreside in private `pngstruct.h` and `pnginfo.h` header files that are
82*a67afe4dSAndroid Build Coastguard Workernot accessible to applications.  It is strongly suggested that new
83*a67afe4dSAndroid Build Coastguard Workerprograms use the new APIs (as shown in `example.c` and `pngtest.c`),
84*a67afe4dSAndroid Build Coastguard Workerand older programs be converted to the new format, to facilitate
85*a67afe4dSAndroid Build Coastguard Workerupgrades in the future.
86*a67afe4dSAndroid Build Coastguard Worker
87*a67afe4dSAndroid Build Coastguard WorkerThe additions since 0.89 include the ability to read from a PNG stream
88*a67afe4dSAndroid Build Coastguard Workerwhich has had some (or all) of the signature bytes read by the calling
89*a67afe4dSAndroid Build Coastguard Workerapplication.  This also allows the reading of embedded PNG streams that
90*a67afe4dSAndroid Build Coastguard Workerdo not have the PNG file signature.  As well, it is now possible to set
91*a67afe4dSAndroid Build Coastguard Workerthe library action on the detection of chunk CRC errors.  It is possible
92*a67afe4dSAndroid Build Coastguard Workerto set different actions based on whether the CRC error occurred in a
93*a67afe4dSAndroid Build Coastguard Workercritical or an ancillary chunk.
94*a67afe4dSAndroid Build Coastguard Worker
95*a67afe4dSAndroid Build Coastguard WorkerThe additions since 0.90 include the ability to compile libpng as a
96*a67afe4dSAndroid Build Coastguard WorkerWindows DLL, and new APIs for accessing data in the `info_struct`.
97*a67afe4dSAndroid Build Coastguard WorkerExperimental functions included the ability to set weighting and cost
98*a67afe4dSAndroid Build Coastguard Workerfactors for row filter selection, direct reads of integers from buffers
99*a67afe4dSAndroid Build Coastguard Workeron big-endian processors that support misaligned data access, faster
100*a67afe4dSAndroid Build Coastguard Workermethods of doing alpha composition, and more accurate 16-to-8 bit color
101*a67afe4dSAndroid Build Coastguard Workerconversion.  Some of these experimental functions, such as the weighted
102*a67afe4dSAndroid Build Coastguard Workerfilter heuristics, have since been removed.
103*a67afe4dSAndroid Build Coastguard Worker
104*a67afe4dSAndroid Build Coastguard WorkerFiles included in this distribution
105*a67afe4dSAndroid Build Coastguard Worker-----------------------------------
106*a67afe4dSAndroid Build Coastguard Worker
107*a67afe4dSAndroid Build Coastguard Worker    ANNOUNCE      =>  Announcement of this version, with recent changes
108*a67afe4dSAndroid Build Coastguard Worker    AUTHORS       =>  List of contributing authors
109*a67afe4dSAndroid Build Coastguard Worker    CHANGES       =>  Description of changes between libpng versions
110*a67afe4dSAndroid Build Coastguard Worker    INSTALL       =>  Instructions to install libpng
111*a67afe4dSAndroid Build Coastguard Worker    LICENSE       =>  License to use and redistribute libpng
112*a67afe4dSAndroid Build Coastguard Worker    README        =>  This file
113*a67afe4dSAndroid Build Coastguard Worker    TODO          =>  Things not implemented in the current library
114*a67afe4dSAndroid Build Coastguard Worker    TRADEMARK     =>  Trademark information
115*a67afe4dSAndroid Build Coastguard Worker    example.c     =>  Example code for using libpng functions
116*a67afe4dSAndroid Build Coastguard Worker    libpng.3      =>  Manual page for libpng (includes libpng-manual.txt)
117*a67afe4dSAndroid Build Coastguard Worker    libpng-manual.txt  =>  Description of libpng and its functions
118*a67afe4dSAndroid Build Coastguard Worker    libpngpf.3    =>  Manual page for libpng's private functions (deprecated)
119*a67afe4dSAndroid Build Coastguard Worker    png.5         =>  Manual page for the PNG format
120*a67afe4dSAndroid Build Coastguard Worker    png.c         =>  Basic interface functions common to library
121*a67afe4dSAndroid Build Coastguard Worker    png.h         =>  Library function and interface declarations (public)
122*a67afe4dSAndroid Build Coastguard Worker    pngpriv.h     =>  Library function and interface declarations (private)
123*a67afe4dSAndroid Build Coastguard Worker    pngconf.h     =>  System specific library configuration (public)
124*a67afe4dSAndroid Build Coastguard Worker    pngstruct.h   =>  png_struct declaration (private)
125*a67afe4dSAndroid Build Coastguard Worker    pnginfo.h     =>  png_info struct declaration (private)
126*a67afe4dSAndroid Build Coastguard Worker    pngdebug.h    =>  debugging macros (private)
127*a67afe4dSAndroid Build Coastguard Worker    pngerror.c    =>  Error/warning message I/O functions
128*a67afe4dSAndroid Build Coastguard Worker    pngget.c      =>  Functions for retrieving info from struct
129*a67afe4dSAndroid Build Coastguard Worker    pngmem.c      =>  Memory handling functions
130*a67afe4dSAndroid Build Coastguard Worker    pngbar.png    =>  PNG logo, 88x31
131*a67afe4dSAndroid Build Coastguard Worker    pngnow.png    =>  PNG logo, 98x31
132*a67afe4dSAndroid Build Coastguard Worker    pngpread.c    =>  Progressive reading functions
133*a67afe4dSAndroid Build Coastguard Worker    pngread.c     =>  Read data/helper high-level functions
134*a67afe4dSAndroid Build Coastguard Worker    pngrio.c      =>  Lowest-level data read I/O functions
135*a67afe4dSAndroid Build Coastguard Worker    pngrtran.c    =>  Read data transformation functions
136*a67afe4dSAndroid Build Coastguard Worker    pngrutil.c    =>  Read data utility functions
137*a67afe4dSAndroid Build Coastguard Worker    pngset.c      =>  Functions for storing data into the info_struct
138*a67afe4dSAndroid Build Coastguard Worker    pngtest.c     =>  Library test program
139*a67afe4dSAndroid Build Coastguard Worker    pngtest.png   =>  Library test sample image
140*a67afe4dSAndroid Build Coastguard Worker    pngtrans.c    =>  Common data transformation functions
141*a67afe4dSAndroid Build Coastguard Worker    pngwio.c      =>  Lowest-level write I/O functions
142*a67afe4dSAndroid Build Coastguard Worker    pngwrite.c    =>  High-level write functions
143*a67afe4dSAndroid Build Coastguard Worker    pngwtran.c    =>  Write data transformations
144*a67afe4dSAndroid Build Coastguard Worker    pngwutil.c    =>  Write utility functions
145*a67afe4dSAndroid Build Coastguard Worker    arm/          =>  Optimized code for ARM Neon
146*a67afe4dSAndroid Build Coastguard Worker    intel/        =>  Optimized code for INTEL SSE2
147*a67afe4dSAndroid Build Coastguard Worker    loongarch/    =>  Optimized code for LoongArch LSX
148*a67afe4dSAndroid Build Coastguard Worker    mips/         =>  Optimized code for MIPS MSA and MIPS MMI
149*a67afe4dSAndroid Build Coastguard Worker    powerpc/      =>  Optimized code for PowerPC VSX
150*a67afe4dSAndroid Build Coastguard Worker    ci/           =>  Scripts for continuous integration
151*a67afe4dSAndroid Build Coastguard Worker    contrib/      =>  External contributions
152*a67afe4dSAndroid Build Coastguard Worker        arm-neon/     =>  Optimized code for the ARM-NEON platform
153*a67afe4dSAndroid Build Coastguard Worker        mips-msa/     =>  Optimized code for the MIPS-MSA platform
154*a67afe4dSAndroid Build Coastguard Worker        powerpc-vsx/  =>  Optimized code for the POWERPC-VSX platform
155*a67afe4dSAndroid Build Coastguard Worker        examples/     =>  Examples of libpng usage
156*a67afe4dSAndroid Build Coastguard Worker        gregbook/     =>  Source code for PNG reading and writing, from
157*a67afe4dSAndroid Build Coastguard Worker                          "PNG: The Definitive Guide" by Greg Roelofs,
158*a67afe4dSAndroid Build Coastguard Worker                          O'Reilly, 1999
159*a67afe4dSAndroid Build Coastguard Worker        libtests/     =>  Test programs
160*a67afe4dSAndroid Build Coastguard Worker        oss-fuzz/     =>  Files used by the OSS-Fuzz project for fuzz-testing
161*a67afe4dSAndroid Build Coastguard Worker                          libpng
162*a67afe4dSAndroid Build Coastguard Worker        pngexif/      =>  Program to inspect the EXIF information in PNG files
163*a67afe4dSAndroid Build Coastguard Worker        pngminim/     =>  Minimal decoder, encoder, and progressive decoder
164*a67afe4dSAndroid Build Coastguard Worker                          programs demonstrating the use of pngusr.dfa
165*a67afe4dSAndroid Build Coastguard Worker        pngminus/     =>  Simple pnm2png and png2pnm programs
166*a67afe4dSAndroid Build Coastguard Worker        pngsuite/     =>  Test images
167*a67afe4dSAndroid Build Coastguard Worker        testpngs/     =>  Test images
168*a67afe4dSAndroid Build Coastguard Worker        tools/        =>  Various tools
169*a67afe4dSAndroid Build Coastguard Worker        visupng/      =>  VisualPng, a Windows viewer for PNG images
170*a67afe4dSAndroid Build Coastguard Worker    projects/     =>  Project files and workspaces for various IDEs
171*a67afe4dSAndroid Build Coastguard Worker        owatcom/      =>  OpenWatcom project
172*a67afe4dSAndroid Build Coastguard Worker        visualc71/    =>  Microsoft Visual C++ 7.1 workspace
173*a67afe4dSAndroid Build Coastguard Worker        vstudio/      =>  Microsoft Visual Studio workspace
174*a67afe4dSAndroid Build Coastguard Worker    scripts/      =>  Scripts and makefiles for building libpng
175*a67afe4dSAndroid Build Coastguard Worker                      (see scripts/README.txt for the complete list)
176*a67afe4dSAndroid Build Coastguard Worker    tests/        =>  Test scripts
177*a67afe4dSAndroid Build Coastguard Worker
178*a67afe4dSAndroid Build Coastguard WorkerGood luck, and happy coding!
179*a67afe4dSAndroid Build Coastguard Worker
180*a67afe4dSAndroid Build Coastguard Worker * Cosmin Truta (current maintainer, since 2018)
181*a67afe4dSAndroid Build Coastguard Worker * Glenn Randers-Pehrson (former maintainer, 1998-2018)
182*a67afe4dSAndroid Build Coastguard Worker * Andreas Eric Dilger (former maintainer, 1996-1997)
183*a67afe4dSAndroid Build Coastguard Worker * Guy Eric Schalnat (original author and former maintainer, 1995-1996)
184*a67afe4dSAndroid Build Coastguard Worker   (formerly of Group 42, Inc.)
185