Update the documentation

This commit is contained in:
Cosmin Truta 2018-07-29 00:33:12 -04:00
parent b729fff4a3
commit 8440326590
8 changed files with 180 additions and 462 deletions

84
README
View File

@ -4,12 +4,12 @@ See the note about version numbers near the top of png.h.
See INSTALL for instructions on how to install libpng. See INSTALL for instructions on how to install libpng.
Libpng comes in several distribution formats. Get libpng-*.tar.gz or Libpng comes in several distribution formats. Get libpng-*.tar.gz or
libpng-*.tar.xz or if you want UNIX-style line endings in the text files, libpng-*.tar.xz or if you want UNIX-style line endings in the text
or lpng*.7z or lpng*.zip if you want DOS-style line endings. files, or lpng*.7z or lpng*.zip if you want DOS-style line endings.
Version 0.89 was the first official release of libpng. Don't let the 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 fact that it's the first release fool you. The libpng library has been
extensive use and testing since mid-1995. By late 1997 it had in extensive use and testing since mid-1995. By late 1997 it had
finally gotten to the stage where there hadn't been significant finally gotten to the stage where there hadn't been significant
changes to the API in some time, and people have a bad feeling about changes to the API in some time, and people have a bad feeling about
libraries with versions < 1.0. Version 1.0.0 was released in libraries with versions < 1.0. Version 1.0.0 was released in
@ -60,84 +60,48 @@ the library action on the detection of chunk CRC errors. It is possible
to set different actions based on whether the CRC error occurred in a to set different actions based on whether the CRC error occurred in a
critical or an ancillary chunk. critical or an ancillary chunk.
The changes made to the library, and bugs fixed are based on discussions For a detailed description on using libpng, read libpng-manual.txt.
on the PNG-implement mailing list and not on material submitted For examples of libpng in a program, see example.c and pngtest.c. For
privately to Guy, Andreas, or Glenn. They will forward any good usage information and restrictions (what little they are) on libpng,
suggestions to the list. see png.h. For a description on using zlib (the compression library
used by libpng) and zlib's restrictions, see zlib.h
For a detailed description on using libpng, read libpng-manual.txt. For
examples of libpng in a program, see example.c and pngtest.c. For usage
information and restrictions (what little they are) on libpng, see
png.h. For a description on using zlib (the compression library used by
libpng) and zlib's restrictions, see zlib.h
I have included a general makefile, as well as several machine and I have included a general makefile, as well as several machine and
compiler specific ones, but you may have to modify one for your own needs. compiler specific ones, but you may have to modify one for your own
needs.
You should use zlib 1.0.4 or later to run this, but it MAY work with You should use zlib 1.0.4 or later to run this, but it MAY work with
versions as old as zlib 0.95. Even so, there are bugs in older zlib versions as old as zlib 0.95. Even so, there are bugs in older zlib
versions which can cause the output of invalid compression streams for versions which can cause the output of invalid compression streams for
some images. You will definitely need zlib 1.0.4 or later if you are some images.
taking advantage of the MS-DOS "far" structure allocation for the small
and medium memory models. You should also note that zlib is a
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 zlib.net. You should also note that zlib is a 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
https://zlib.net.
You may also want a copy of the PNG specification. It is available 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 as an RFC, a W3C Recommendation, and an ISO/IEC Standard. You can find
these at http://www.libpng.org/pub/png/pngdocs.html . these at http://www.libpng.org/pub/png/pngdocs.html .
This code is currently being archived at libpng.sourceforge.io in the This code is currently being archived at libpng.sourceforge.io in the
[DOWNLOAD] area, and at http://libpng.download/src . If you [DOWNLOAD] area, and at http://libpng.download/src .
can't find it in any of those places, e-mail me, and I'll help you find it.
I am not a lawyer, but I believe that the Export Control Classification
Number (ECCN) for libpng is EAR99, which means not subject to export
controls or International Traffic in Arms Regulations (ITAR) because it
is open source, publicly available software, that does not contain any
encryption software. See the EAR, paragraphs 734.3(b)(3) and 734.7(b).
If you have any code changes, requests, problems, etc., please e-mail
them to me. Also, I'd appreciate any make files or project files,
and any modifications you needed to make to get libpng to compile,
along with a #define variable to tell what compiler/system you are on.
If you needed to add transformations to libpng, or wish libpng would
provide the image in a different way, drop me a note (and code, if
possible), so I can consider supporting the transformation.
Finally, if you get any warning messages when compiling libpng
(note: not zlib), and they are easy to fix, I'd appreciate the
fix. Please mention "libpng" somewhere in the subject line. Thanks.
This release was created and will be supported by myself (of course This release was created and will be supported by myself (of course
based in a large way on Guy's and Andreas' earlier work), and the PNG based in a large way on Glenn's, Guy's and Andreas' earlier work), and
development group. the PNG development group.
Send comments/corrections/commendations to png-mng-implement at Send comments/corrections/commendations to png-mng-implement at
lists.sourceforge.net (subscription required; visit lists.sourceforge.net (subscription required; visit
https://lists.sourceforge.net/lists/listinfo/png-mng-implement https://lists.sourceforge.net/lists/listinfo/png-mng-implement
to subscribe). to subscribe).
You can't reach Guy, the original libpng author, at the addresses Send general questions about the PNG specification to png-mng-misc
given in previous versions of this document. He and Andreas will at lists.sourceforge.net (subscription required; visit
read mail addressed to the png-implement list, however.
Please do not send general questions about PNG. Send them to
png-mng-misc at lists.sf.net (subscription required; visit
https://lists.sourceforge.net/lists/listinfo/png-mng-misc to https://lists.sourceforge.net/lists/listinfo/png-mng-misc to
subscribe). If you have a question about something subscribe).
in the PNG specification that is related to using libpng, send it
to me. Send me any questions that start with "I was using libpng,
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 twenty 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.
Files in this distribution: Files in this distribution:

49
TODO
View File

@ -1,30 +1,23 @@
/*
TODO - list of things to do for libpng: TODO - list of things to do for libpng:
Final bug fixes. * Fix all defects (duh!)
Better C++ wrapper/full C++ implementation? * Better C++ wrapper / full C++ implementation (?)
Fix problem with C++ and EXTERN "C". * Fix the problems with C++ and 'extern "C"'.
cHRM transformation. * cHRM transformation.
Remove setjmp/longjmp usage in favor of returning error codes. As a start on * Palette creation.
this, minimize the use of png_error(), replacing them with * "grayscale->palette" transformation and "palette->grayscale" detection.
png_warning(); return(0); or similar. * Improved dithering.
Palette creation. * Multi-lingual error and warning message support.
Add "grayscale->palette" transformation and "palette->grayscale" detection. * Complete sRGB transformation. (Currently it simply uses gamma=0.45455.)
Improved dithering. * Man pages for function calls.
Multi-lingual error and warning message support. * Better documentation.
Complete sRGB transformation (presently it simply uses gamma=0.45455). * Better filter selection
Man pages for function calls. (e.g., counting huffman bits/precompression; filter inertia; filter costs).
Better documentation. * Histogram creation.
Better filter selection * Text conversion between different code pages (e.g., Latin-1 -> Mac).
(counting huffman bits/precompression? filter inertia? filter costs?). * Avoid building gamma tables whenever possible.
Histogram creation. * Greater precision in changing to linear gamma for compositing against
Text conversion between different code pages (Latin-1 -> Mac and DOS). background, and in doing rgb-to-gray transformations.
Avoid building gamma tables whenever possible. * Investigate pre-incremented loop counters and other loop constructions.
Use greater precision when changing to linear gamma for compositing against * Interpolated method of handling interlacing.
background and doing rgb-to-gray transformation. * More validations for libpng transformations.
Investigate pre-incremented loop counters and other loop constructions.
Add interpolated method of handling interlacing.
Extend pngvalid.c to validate more of the libpng transformations.
Refactor preprocessor conditionals to compile entire statements
*/

View File

@ -1,7 +1,6 @@
libpng-manual.txt - A description on how to use and modify libpng libpng-manual.txt - A description on how to use and modify libpng
libpng version 1.6.35 - July 15, 2018 Copyright (c) 2018 Cosmin Truta
Updated and distributed by Glenn Randers-Pehrson
Copyright (c) 1998-2018 Glenn Randers-Pehrson Copyright (c) 1998-2018 Glenn Randers-Pehrson
This document is released under the libpng license. This document is released under the libpng license.
@ -12,7 +11,7 @@ libpng-manual.txt - A description on how to use and modify libpng
libpng versions 0.97, January 1998, through 1.6.35 - July 15, 2018 libpng versions 0.97, January 1998, through 1.6.35 - July 15, 2018
Updated and distributed by Glenn Randers-Pehrson Updated and distributed by Glenn Randers-Pehrson
Copyright (c) 1998-2017 Glenn Randers-Pehrson Copyright (c) 1998-2018 Glenn Randers-Pehrson
libpng 1.0 beta 6 - version 0.96 - May 28, 1997 libpng 1.0 beta 6 - version 0.96 - May 28, 1997
Updated and distributed by Andreas Dilger Updated and distributed by Andreas Dilger
@ -44,7 +43,6 @@ libpng-manual.txt - A description on how to use and modify libpng
XIII. Detecting libpng XIII. Detecting libpng
XIV. Source code repository XIV. Source code repository
XV. Coding style XV. Coding style
XVI. Y2K Compliance in libpng
I. Introduction I. Introduction
@ -5255,7 +5253,7 @@ or you can browse it with a web browser at
https://sourceforge.net/p/libpng/code/ci/libpng16/tree/ https://sourceforge.net/p/libpng/code/ci/libpng16/tree/
Patches can be sent to png-mng-implement at lists.sourceforge.net or Patches can be sent to png-mng-implement at lists.sourceforge.net or
you can upload them to the libpng bug tracker at uploaded to the libpng bug tracker at
https://libpng.sourceforge.io/ https://libpng.sourceforge.io/
@ -5405,58 +5403,3 @@ We do not use the TAB character for indentation in the C sources.
Lines do not exceed 80 characters. Lines do not exceed 80 characters.
Other rules can be inferred by inspecting the libpng source. Other rules can be inferred by inspecting the libpng source.
XVI. Y2K Compliance in libpng
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.6.35 are Y2K compliant. It is my belief that earlier
versions were also Y2K compliant.
Libpng only has two year fields. One is a 2-byte unsigned integer
that will hold years up to 65535. The other, which is deprecated,
holds the date in text format, and will hold years up to 9999.
The integer is
"png_uint_16 year" in png_time_struct.
The string is
"char time_buffer[29]" in png_struct. This is no longer used
in libpng-1.6.x and will be removed from libpng-1.7.0.
There are seven time-related functions:
png_convert_to_rfc_1123_buffer() in png.c
(formerly png_convert_to_rfc_1152() in error, and
also formerly png_convert_to_rfc_1123())
png_convert_from_struct_tm() in pngwrite.c, called
in pngwrite.c
png_convert_from_time_t() in pngwrite.c
png_get_tIME() in pngget.c
png_handle_tIME() in pngrutil.c, called in pngread.c
png_set_tIME() in pngset.c
png_write_tIME() in pngwutil.c, called in pngwrite.c
All appear to handle dates properly in a Y2K environment. The
png_convert_from_time_t() function calls gmtime() to convert from system
clock time, which returns (year - 1900), which we properly convert to
the full 4-digit year. There is a possibility that applications using
libpng are not passing 4-digit years into the png_convert_to_rfc_1123()
function, or that they are incorrectly passing only a 2-digit year
instead of "year - 1900" into the png_convert_from_struct_tm() function,
but this is not under our control. The libpng documentation has always
stated that it works with 4-digit years, and the APIs have been
documented as such.
The tIME chunk itself is also Y2K compliant. It uses a 2-byte unsigned
integer to hold the year, and can hold years as large as 65535.
zlib, upon which libpng depends, is also Y2K compliant. It contains
no date-related code.
Glenn Randers-Pehrson
libpng maintainer
PNG Development Group

261
libpng.3
View File

@ -1,11 +1,11 @@
.TH LIBPNG 3 "July 15, 2018" .TH LIBPNG 3 "2018-Jul-29"
.SH NAME .SH NAME
libpng \- Portable Network Graphics (PNG) Reference Library 1.6.35 libpng \- Portable Network Graphics (PNG) Reference Library 1.6.36.git
.SH SYNOPSIS
\fB
#include <png.h>\fP
\fBpng_uint_32 png_access_version_number \fI(void\fP\fB);\fP .SH SYNOPSIS
\fB#include <png.h>\fP
\fBpng_uint_32 png_access_version_number (void);\fP
\fBvoid png_benign_error (png_structp \fP\fIpng_ptr\fP\fB, png_const_charp \fIerror\fP\fB);\fP \fBvoid png_benign_error (png_structp \fP\fIpng_ptr\fP\fB, png_const_charp \fIerror\fP\fB);\fP
@ -35,7 +35,7 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.6.35
\fBpng_structp png_create_write_struct_2 (png_const_charp \fP\fIuser_png_ver\fP\fB, png_voidp \fP\fIerror_ptr\fP\fB, png_error_ptr \fP\fIerror_fn\fP\fB, png_error_ptr \fP\fIwarn_fn\fP\fB, png_voidp \fP\fImem_ptr\fP\fB, png_malloc_ptr \fP\fImalloc_fn\fP\fB, png_free_ptr \fIfree_fn\fP\fB);\fP \fBpng_structp png_create_write_struct_2 (png_const_charp \fP\fIuser_png_ver\fP\fB, png_voidp \fP\fIerror_ptr\fP\fB, png_error_ptr \fP\fIerror_fn\fP\fB, png_error_ptr \fP\fIwarn_fn\fP\fB, png_voidp \fP\fImem_ptr\fP\fB, png_malloc_ptr \fP\fImalloc_fn\fP\fB, png_free_ptr \fIfree_fn\fP\fB);\fP
\fBvoid png_data_freer (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, int \fP\fIfreer\fP\fB, png_uint_32 \fImask)\fP\fB);\fP \fBvoid png_data_freer (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, int \fP\fIfreer\fP\fB, png_uint_32 \fImask\fP\fB);\fP
\fBvoid png_destroy_info_struct (png_structp \fP\fIpng_ptr\fP\fB, png_infopp \fIinfo_ptr_ptr\fP\fB);\fP \fBvoid png_destroy_info_struct (png_structp \fP\fIpng_ptr\fP\fB, png_infopp \fIinfo_ptr_ptr\fP\fB);\fP
@ -233,9 +233,9 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.6.35
\fBint png_image_write_to_file (png_imagep \fP\fIimage\fP\fB, const char \fP\fI*file\fP\fB, int \fP\fIconvert_to_8bit\fP\fB, const void \fP\fI*buffer\fP\fB, png_int_32 \fP\fIrow_stride\fP\fB, void \fI*colormap\fP\fB);\fP \fBint png_image_write_to_file (png_imagep \fP\fIimage\fP\fB, const char \fP\fI*file\fP\fB, int \fP\fIconvert_to_8bit\fP\fB, const void \fP\fI*buffer\fP\fB, png_int_32 \fP\fIrow_stride\fP\fB, void \fI*colormap\fP\fB);\fP
\fBint png_image_write_to_memory (png_imagep \fP\fIimage\fP\fB, void \fP\fI*memory\fP\fB, png_alloc_size_t * PNG_RESTRICT \fP\fImemory_bytes\fP\fB, int \fP\fIconvert_to_8_bit\fP\fB, const void \fP\fI*buffer\fP\fB, png_int_32 \fP\fIrow_stride\fP\fB, const void \fI*colormap)\fP\fB);\fP \fBint png_image_write_to_memory (png_imagep \fP\fIimage\fP\fB, void \fP\fI*memory\fP\fB, png_alloc_size_t * PNG_RESTRICT \fP\fImemory_bytes\fP\fB, int \fP\fIconvert_to_8_bit\fP\fB, const void \fP\fI*buffer\fP\fB, png_int_32 \fP\fIrow_stride\fP\fB, const void \fI*colormap\fP\fB);\fP
\fBint png_image_write_to_stdio (png_imagep \fP\fIimage\fP\fB, FILE \fP\fI*file\fP\fB, int \fP\fIconvert_to_8_bit\fP\fB, const void \fP\fI*buffer\fP\fB, png_int_32 \fP\fIrow_stride\fP\fB, void \fI*colormap)\fP\fB);\fP \fBint png_image_write_to_stdio (png_imagep \fP\fIimage\fP\fB, FILE \fP\fI*file\fP\fB, int \fP\fIconvert_to_8_bit\fP\fB, const void \fP\fI*buffer\fP\fB, png_int_32 \fP\fIrow_stride\fP\fB, void \fI*colormap\fP\fB);\fP
\fBvoid png_info_init_3 (png_infopp \fP\fIinfo_ptr\fP\fB, size_t \fIpng_info_struct_size\fP\fB);\fP \fBvoid png_info_init_3 (png_infopp \fP\fIinfo_ptr\fP\fB, size_t \fIpng_info_struct_size\fP\fB);\fP
@ -253,9 +253,9 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.6.35
\fBvoid png_process_data (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_bytep \fP\fIbuffer\fP\fB, size_t \fIbuffer_size\fP\fB);\fP \fBvoid png_process_data (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_bytep \fP\fIbuffer\fP\fB, size_t \fIbuffer_size\fP\fB);\fP
\fBsize_t png_process_data_pause \fP\fI(png_structp\fP\fB, int \fIsave\fP\fB);\fP \fBsize_t png_process_data_pause (png_structp \fP\fIpng_ptr\fP\fB, int \fIsave\fP\fB);\fP
\fBpng_uint_32 png_process_data_skip \fI(png_structp\fP\fB);\fP \fBpng_uint_32 png_process_data_skip (png_structp \fP\fIpng_ptr\fP\fB);\fP
\fBvoid png_progressive_combine_row (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIold_row\fP\fB, png_bytep \fInew_row\fP\fB);\fP \fBvoid png_progressive_combine_row (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIold_row\fP\fB, png_bytep \fInew_row\fP\fB);\fP
@ -297,7 +297,7 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.6.35
\fBvoid png_set_bKGD (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_color_16p \fIbackground\fP\fB);\fP \fBvoid png_set_bKGD (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_color_16p \fIbackground\fP\fB);\fP
\fBvoid png_set_check_for_invalid_index(png_structrp \fP\fIpng_ptr\fP\fB, int \fIallowed\fP\fB);\fP \fBvoid png_set_check_for_invalid_index (png_structrp \fP\fIpng_ptr\fP\fB, int \fIallowed\fP\fB);\fP
\fBvoid png_set_cHRM (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, double \fP\fIwhite_x\fP\fB, double \fP\fIwhite_y\fP\fB, double \fP\fIred_x\fP\fB, double \fP\fIred_y\fP\fB, double \fP\fIgreen_x\fP\fB, double \fP\fIgreen_y\fP\fB, double \fP\fIblue_x\fP\fB, double \fIblue_y\fP\fB);\fP \fBvoid png_set_cHRM (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, double \fP\fIwhite_x\fP\fB, double \fP\fIwhite_y\fP\fB, double \fP\fIred_x\fP\fB, double \fP\fIred_y\fP\fB, double \fP\fIgreen_x\fP\fB, double \fP\fIgreen_y\fP\fB, double \fP\fIblue_x\fP\fB, double \fIblue_y\fP\fB);\fP
@ -453,7 +453,7 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.6.35
\fBvoid png_set_text_compression_window_bits (png_structp \fP\fIpng_ptr\fP\fB, int \fIwindow_bits\fP\fB);\fP \fBvoid png_set_text_compression_window_bits (png_structp \fP\fIpng_ptr\fP\fB, int \fIwindow_bits\fP\fB);\fP
\fBvoid \fP\fIpng_set_text_compression_method\fP\fB, (png_structp \fP\fIpng_ptr\fP\fB, int \fImethod)\fP\fB);\fP \fBvoid png_set_text_compression_method (png_structp \fP\fIpng_ptr\fP\fB, int \fImethod\fP\fB);\fP
\fBvoid png_set_tIME (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_timep \fImod_time\fP\fB);\fP \fBvoid png_set_tIME (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_timep \fImod_time\fP\fB);\fP
@ -515,11 +515,11 @@ the Portable Network Graphics (PNG) format image files. It uses the
.IR zlib(3) .IR zlib(3)
compression library. compression library.
Following is a copy of the libpng-manual.txt file that accompanies libpng. Following is a copy of the libpng-manual.txt file that accompanies libpng.
.SH LIBPNG.TXT .SH LIBPNG.TXT
libpng-manual.txt - A description on how to use and modify libpng libpng-manual.txt - A description on how to use and modify libpng
libpng version 1.6.35 - July 15, 2018 Copyright (c) 2018 Cosmin Truta
Updated and distributed by Glenn Randers-Pehrson
Copyright (c) 1998-2018 Glenn Randers-Pehrson Copyright (c) 1998-2018 Glenn Randers-Pehrson
This document is released under the libpng license. This document is released under the libpng license.
@ -530,7 +530,7 @@ libpng-manual.txt - A description on how to use and modify libpng
libpng versions 0.97, January 1998, through 1.6.35 - July 15, 2018 libpng versions 0.97, January 1998, through 1.6.35 - July 15, 2018
Updated and distributed by Glenn Randers-Pehrson Updated and distributed by Glenn Randers-Pehrson
Copyright (c) 1998-2017 Glenn Randers-Pehrson Copyright (c) 1998-2018 Glenn Randers-Pehrson
libpng 1.0 beta 6 - version 0.96 - May 28, 1997 libpng 1.0 beta 6 - version 0.96 - May 28, 1997
Updated and distributed by Andreas Dilger Updated and distributed by Andreas Dilger
@ -562,7 +562,6 @@ libpng-manual.txt - A description on how to use and modify libpng
XIII. Detecting libpng XIII. Detecting libpng
XIV. Source code repository XIV. Source code repository
XV. Coding style XV. Coding style
XVI. Y2K Compliance in libpng
.SH I. Introduction .SH I. Introduction
@ -5924,61 +5923,6 @@ Lines do not exceed 80 characters.
Other rules can be inferred by inspecting the libpng source. Other rules can be inferred by inspecting the libpng source.
.SH XVI. Y2K Compliance in libpng
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.6.35 are Y2K compliant. It is my belief that earlier
versions were also Y2K compliant.
Libpng only has two year fields. One is a 2-byte unsigned integer
that will hold years up to 65535. The other, which is deprecated,
holds the date in text format, and will hold years up to 9999.
The integer is
"png_uint_16 year" in png_time_struct.
The string is
"char time_buffer[29]" in png_struct. This is no longer used
in libpng-1.6.x and will be removed from libpng-1.7.0.
There are seven time-related functions:
png_convert_to_rfc_1123_buffer() in png.c
(formerly png_convert_to_rfc_1152() in error, and
also formerly png_convert_to_rfc_1123())
png_convert_from_struct_tm() in pngwrite.c, called
in pngwrite.c
png_convert_from_time_t() in pngwrite.c
png_get_tIME() in pngget.c
png_handle_tIME() in pngrutil.c, called in pngread.c
png_set_tIME() in pngset.c
png_write_tIME() in pngwutil.c, called in pngwrite.c
All appear to handle dates properly in a Y2K environment. The
png_convert_from_time_t() function calls gmtime() to convert from system
clock time, which returns (year - 1900), which we properly convert to
the full 4-digit year. There is a possibility that applications using
libpng are not passing 4-digit years into the png_convert_to_rfc_1123()
function, or that they are incorrectly passing only a 2-digit year
instead of "year - 1900" into the png_convert_from_struct_tm() function,
but this is not under our control. The libpng documentation has always
stated that it works with 4-digit years, and the APIs have been
documented as such.
The tIME chunk itself is also Y2K compliant. It uses a 2-byte unsigned
integer to hold the year, and can hold years as large as 65535.
zlib, upon which libpng depends, is also Y2K compliant. It contains
no date-related code.
Glenn Randers-Pehrson
libpng maintainer
PNG Development Group
.SH NOTE .SH NOTE
Note about libpng version numbers: Note about libpng version numbers:
@ -6026,23 +5970,25 @@ the first widely used release:
1.0.7rc1-2 1 10007 2.1.0.7rc1-2 (binary compatible) 1.0.7rc1-2 1 10007 2.1.0.7rc1-2 (binary compatible)
1.0.7 1 10007 (still compatible) 1.0.7 1 10007 (still compatible)
... ...
1.0.19 10 10019 10.so.0.19[.0] 1.0.69 10 10069 10.so.0.69[.0]
... ...
1.2.59 13 10259 12.so.0.59[.0] 1.2.59 13 10259 12.so.0.59[.0]
... ...
1.4.20 14 10420 14.so.0.20[.0]
...
1.5.30 15 10530 15.so.15.30[.0] 1.5.30 15 10530 15.so.15.30[.0]
... ...
1.6.35 16 10635 16.so.16.35[.0] 1.6.35 16 10635 16.so.16.35[.0]
Henceforth the source version will match the shared-library minor Henceforth the source version will match the shared-library minor and
and patch numbers; the shared-library major version number will be patch numbers; the shared-library major version number will be used for
used for changes in backward compatibility, as it is intended. The changes in backward compatibility, as it is intended.
PNG_PNGLIB_VER macro, which is not used within libpng but is available The PNG_PNGLIB_VER macro, which is not used within libpng but is
for applications, is an unsigned integer of the form xyyzz corresponding available for applications, is an unsigned integer of the form XYYZZ
to the source version x.y.z (leading zeros in y and z). Beta versions corresponding to the source version X.Y.Z (leading zeros in Y and Z).
were given the previous public release number plus a letter, until Beta versions were given the previous public release number plus a
version 1.0.6j; from then on they were given the upcoming public letter, until version 1.0.6j; from then on they were given the upcoming
release number plus "betaNN" or "rcNN". public release number plus "betaNN" or "rcNN".
.SH "SEE ALSO" .SH "SEE ALSO"
.IR libpngpf(3) ", " png(5) .IR libpngpf(3) ", " png(5)
@ -6079,8 +6025,9 @@ In the case of any inconsistency between the PNG specification
and this library, the specification takes precedence. and this library, the specification takes precedence.
.SH AUTHORS .SH AUTHORS
This man page: Glenn Randers-Pehrson This man page:
<glennrp at users.sourceforge.net> Initially created by Glenn Randers-Pehrson.
Maintained by Cosmin Truta.
The contributing authors would like to thank all those who helped The contributing authors would like to thank all those who helped
with testing, bug fixes, and patience. This wouldn't have been with testing, bug fixes, and patience. This wouldn't have been
@ -6088,9 +6035,9 @@ possible without all of you.
Thanks to Frank J. T. Wojcik for helping with the documentation. Thanks to Frank J. T. Wojcik for helping with the documentation.
Libpng version 1.6.35 - July 15, 2018: Libpng:
Initially created in 1995 by Guy Eric Schalnat, then of Group 42, Inc. Initially created in 1995 by Guy Eric Schalnat, then of Group 42, Inc.
Maintained by Glenn Randers-Pehrson. Maintained by Cosmin Truta.
Supported by the PNG development group Supported by the PNG development group
.br .br
@ -6100,146 +6047,4 @@ png-mng-implement at lists.sourceforge.net (subscription required; visit
https://lists.sourceforge.net/lists/listinfo/png-mng-implement https://lists.sourceforge.net/lists/listinfo/png-mng-implement
to subscribe). to subscribe).
.SH NOTICES:
This copy of the libpng notices is provided for your convenience. In case of
any discrepancy between this copy and the notices in the file png.h that is
included in the libpng distribution, the latter shall prevail.
COPYRIGHT NOTICE, DISCLAIMER, and LICENSE:
If you modify libpng you may insert additional notices immediately following
this sentence.
This code is released under the libpng license.
libpng versions 1.0.7, July 1, 2000 through 1.6.35, July 15, 2018 are
Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson, are
derived from libpng-1.0.6, and are distributed according to the same
disclaimer and license as libpng-1.0.6 with the following individuals
added to the list of Contributing Authors:
Simon-Pierre Cadieux
Eric S. Raymond
Mans Rullgard
Cosmin Truta
Gilles Vollant
James Yu
Mandar Sahastrabuddhe
Google Inc.
Vadim Barkov
and with the following additions to the disclaimer:
There is no warranty against interference with your enjoyment of the
library or against infringement. There is no warranty that our
efforts or the library will fulfill any of your particular purposes
or needs. This library is provided with all faults, and the entire
risk of satisfactory quality, performance, accuracy, and effort is with
the user.
Some files in the "contrib" directory and some configure-generated
files that are distributed with libpng have other copyright owners and
are released under other open source licenses.
libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are
Copyright (c) 1998-2000 Glenn Randers-Pehrson, are derived from
libpng-0.96, and are distributed according to the same disclaimer and
license as libpng-0.96, with the following individuals added to the list
of Contributing Authors:
Tom Lane
Glenn Randers-Pehrson
Willem van Schaik
libpng versions 0.89, June 1996, through 0.96, May 1997, are
Copyright (c) 1996-1997 Andreas Dilger, are derived from libpng-0.88,
and are distributed according to the same disclaimer and license as
libpng-0.88, with the following individuals added to the list of
Contributing Authors:
John Bowler
Kevin Bracey
Sam Bushell
Magnus Holmgren
Greg Roelofs
Tom Tanner
Some files in the "scripts" directory have other copyright owners
but are released under this license.
libpng versions 0.5, May 1995, through 0.88, January 1996, are
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
For the purposes of this copyright and license, "Contributing Authors"
is defined as the following set of individuals:
Andreas Dilger
Dave Martindale
Guy Eric Schalnat
Paul Schmidt
Tim Wegner
The PNG Reference Library is supplied "AS IS". The Contributing Authors
and Group 42, Inc. disclaim all warranties, expressed or implied,
including, without limitation, the warranties of merchantability and of
fitness for any purpose. The Contributing Authors and Group 42, Inc.
assume no liability for direct, indirect, incidental, special, exemplary,
or consequential damages, which may result from the use of the PNG
Reference Library, even if advised of the possibility of such damage.
Permission is hereby granted to use, copy, modify, and distribute this
source code, or portions hereof, for any purpose, without fee, subject
to the following restrictions:
1. The origin of this source code must not be misrepresented.
2. Altered versions must be plainly marked as such and must not
be misrepresented as being the original source.
3. This Copyright notice may not be removed or altered from any
source or altered source distribution.
The Contributing Authors and Group 42, Inc. specifically permit, without
fee, and encourage the use of this source code as a component to
supporting the PNG file format in commercial products. If you use this
source code in a product, acknowledgment is not required but would be
appreciated.
END OF COPYRIGHT NOTICE, DISCLAIMER, and LICENSE.
TRADEMARK:
The name "libpng" has not been registered by the Copyright owner
as a trademark in any jurisdiction. However, because libpng has
been distributed and maintained world-wide, continually since 1995,
the Copyright owner claims "common-law trademark protection" in any
jurisdiction where common-law trademark is recognized.
OSI CERTIFICATION:
Libpng is OSI Certified Open Source Software. OSI Certified Open Source is
a certification mark of the Open Source Initiative. OSI has not addressed
the additional disclaimers inserted at version 1.0.7.
EXPORT CONTROL:
The Copyright owner believes that the Export Control Classification
Number (ECCN) for libpng is EAR99, which means not subject to export
controls or International Traffic in Arms Regulations (ITAR) because
it is open source, publicly available software, that does not contain
any encryption software. See the EAR, paragraphs 734.3(b)(3) and
734.7(b).
A "png_get_copyright" function is available, for convenient use in "about"
boxes and the like:
printf("%s", png_get_copyright(NULL));
Also, the PNG logo (in PNG format, of course) is supplied in the
files "pngbar.png" and "pngbar.jpg (88x31) and "pngnow.png" (98x31).
Glenn Randers-Pehrson
July 15, 2018
.\" end of man page .\" end of man page

View File

@ -1,7 +1,8 @@
.TH LIBPNGPF 3 "July 15, 2018" .TH LIBPNGPF 3 "2018-Jul-29"
.SH NAME .SH NAME
libpng \- Portable Network Graphics (PNG) Reference Library 1.6.35 libpng \- Portable Network Graphics (PNG) Reference Library 1.6.36.git
(private functions) (private functions)
.SH SYNOPSIS .SH SYNOPSIS
\fB#include \fI"pngpriv.h" \fB#include \fI"pngpriv.h"
@ -16,7 +17,8 @@ The functions previously listed here are used privately by libpng and are not
available for use by applications. They are not "exported" to applications available for use by applications. They are not "exported" to applications
using shared libraries. using shared libraries.
.SH SEE ALSO .SH "SEE ALSO"
.BR "png"(5), " libpng"(3), " zlib"(3), " deflate"(5), " " and " zlib"(5) .BR "png"(5), " libpng"(3), " zlib"(3), " deflate"(5), " " and " zlib"(5)
.SH AUTHOR
Glenn Randers-Pehrson .SH AUTHORS
Cosmin Truta, Glenn Randers-Pehrson

64
png.5
View File

@ -1,47 +1,49 @@
.TH PNG 5 "April 1, 2017" .TH PNG 5 "2018-Jul-29"
.SH NAME .SH NAME
png \- Portable Network Graphics (PNG) format png \- Portable Network Graphics (PNG) format
.SH DESCRIPTION .SH DESCRIPTION
PNG (Portable Network Graphics) is an extensible file format for the PNG (Portable Network Graphics) is an extensible file format for the
lossless, portable, well-compressed storage of raster images. PNG provides lossless, portable, well-compressed storage of raster images. PNG
a patent-free replacement for GIF and can also replace many provides a patent-free replacement for GIF, and can also replace many
common uses of TIFF. Indexed-color, grayscale, and truecolor images are common uses of TIFF. Indexed-color, grayscale, and truecolor images are
supported, plus an optional alpha channel. Sample depths range from supported, plus an optional alpha channel. Sample depths range from
1 to 16 bits. 1 to 16 bits.
.br .br
PNG is designed to work well in online viewing applications, such
PNG is designed to work well in online viewing applications, such as the as the World Wide Web, so it is fully streamable with a progressive
World Wide Web, so it is fully streamable with a progressive display display option. PNG is robust, providing both full file integrity
option. PNG is robust, providing both full file integrity checking and checking and fast, simple detection of common transmission errors.
fast, simple detection of common transmission errors. Also, PNG can store Also, PNG can store gamma and chromaticity data for improved color
gamma and chromaticity data for improved color matching on heterogeneous matching on heterogeneous platforms.
platforms.
.SH "SEE ALSO" .SH "SEE ALSO"
.BR "libpng"(3), " libpngpf"(3), " zlib"(3), " deflate"(5), " " and " zlib"(5) .BR "libpng"(3), " libpngpf"(3), " zlib"(3), " deflate"(5), " " and " zlib"(5)
.LP .LP
PNG specification (second edition), November 2003: PNG Specification (Second Edition), November 2003:
.IP .IP
.br .br
<https://www.w3.org/TR/2003/REC-PNG-20031110/ https://www.w3.org/TR/2003/REC-PNG-20031110/
PNG 1.2 specification, July 1999: .LP
PNG 1.2 Specification, July 1999:
.IP .IP
.br .br
https://png-mng.sourceforge.io/pub/png/spec/1.2/ https://png-mng.sourceforge.io/pub/png/spec/1.2/
.LP .LP
PNG 1.0 specification, October 1996: PNG 1.0 Specification, October 1996:
.IP .IP
.br .br
RFC 2083 RFC 2083
.IP
.br .br
https://www.ietf.org/rfc/rfc2083.txt https://www.ietf.org/rfc/rfc2083.txt
.IP
.br .br
or (as a W3C Recommendation) at or W3C Recommendation
.br .br
https://www.w3.org/TR/REC-png-961001 https://www.w3.org/TR/REC-png-961001
.SH AUTHORS .SH AUTHORS
This man page: Glenn Randers-Pehrson This man page: Cosmin Truta, Glenn Randers-Pehrson
.LP .LP
Portable Network Graphics (PNG) Specification (Second Edition) Portable Network Graphics (PNG) Specification (Second Edition)
Information technology - Computer graphics and image processing - Information technology - Computer graphics and image processing -
@ -53,22 +55,30 @@ Glenn Randers-Pehrson and others (png-list).
.LP .LP
Portable Network Graphics (PNG) Specification Version 1.0 (October 1, 1996): Portable Network Graphics (PNG) Specification Version 1.0 (October 1, 1996):
Thomas Boutell and others (png-list). Thomas Boutell and others (png-list).
.LP
.SH COPYRIGHT
.SH COPYRIGHT NOTICE
.LP .LP
This man page is Copyright (c) 1998-2006 Glenn Randers-Pehrson. See png.h This man page is
for conditions of use and distribution. .br
Copyright (c) 2018 Cosmin Truta.
.br
Copyright (c) 1998-2006 Glenn Randers-Pehrson.
.br
See png.h for conditions of use and distribution.
.LP .LP
The PNG Specification (Second Edition) is The PNG Specification (Second Edition) is
.br
Copyright (c) 2003 W3C. (MIT, ERCIM, Keio), All Rights Reserved. Copyright (c) 2003 W3C. (MIT, ERCIM, Keio), All Rights Reserved.
.LP .LP
The PNG-1.2 specification is copyright (c) 1999 Glenn Randers-Pehrson. The PNG-1.2 Specification is
.br
Copyright (c) 1999 Glenn Randers-Pehrson.
.br
See the specification for conditions of use and distribution. See the specification for conditions of use and distribution.
.LP .LP
The PNG-1.0 specification is copyright (c) 1996 Massachusetts Institute of The PNG-1.0 Specification is
Technology. See the specification for conditions of use and distribution. .br
.LP Copyright (c) 1996 Massachusetts Institute of Technology.
.br
See the specification for conditions of use and distribution.
.\" end of man page .\" end of man page

33
png.h
View File

@ -221,15 +221,15 @@
* ... * ...
* 1.6.35 16 10635 16.so.16.35[.0] * 1.6.35 16 10635 16.so.16.35[.0]
* *
* Henceforth the source version will match the shared-library major * Henceforth the source version will match the shared-library major and
* and minor numbers; the shared-library major version number will be * minor numbers; the shared-library major version number will be used for
* used for changes in backward compatibility, as it is intended. The * changes in backward compatibility, as it is intended.
* PNG_LIBPNG_VER macro, which is not used within libpng but is available * The PNG_LIBPNG_VER macro, which is not used within libpng but is
* for applications, is an unsigned integer of the form xyyzz corresponding * available for applications, is an unsigned integer of the form XYYZZ
* to the source version x.y.z (leading zeros in y and z). Beta versions * corresponding to the source version X.Y.Z (leading zeros in Y and Z).
* were given the previous public release number plus a letter, until * Beta versions were given the previous public release number plus a
* version 1.0.6j; from then on they were given the upcoming public * letter, until version 1.0.6j; from then on they were given the upcoming
* release number plus "betaNN" or "rcNN". * public release number plus "betaNN" or "rcNN".
* *
* Binary incompatibility exists only when applications make direct access * Binary incompatibility exists only when applications make direct access
* to the info_ptr or png_ptr members through png.h, and the compiled * to the info_ptr or png_ptr members through png.h, and the compiled
@ -240,7 +240,7 @@
* *
* See libpng.txt or libpng.3 for more information. The PNG specification * See libpng.txt or libpng.3 for more information. The PNG specification
* is available as a W3C Recommendation and as an ISO Specification, * is available as a W3C Recommendation and as an ISO Specification,
* <https://www.w3.org/TR/2003/REC-PNG-20031110/ * <https://www.w3.org/TR/2003/REC-PNG-20031110/>
*/ */
#ifndef PNG_H #ifndef PNG_H
@ -292,11 +292,12 @@
#define PNG_LIBPNG_BUILD_BASE_TYPE PNG_LIBPNG_BUILD_BETA #define PNG_LIBPNG_BUILD_BASE_TYPE PNG_LIBPNG_BUILD_BETA
/* Careful here. At one time, Guy wanted to use 082, but that would be octal. /* Careful here. At one time, Guy wanted to use 082, but that
* We must not include leading zeros. * would be octal. We must not include leading zeros.
* Versions 0.7 through 1.0.0 were in the range 0 to 100 here (only * Versions 0.7 through 1.0.0 were in the range 0 to 100 here
* version 1.0.0 was mis-numbered 100 instead of 10000). From * (only version 1.0.0 was mis-numbered 100 instead of 10000).
* version 1.0.1 it's xxyyzz, where x=major, y=minor, z=release * From version 1.0.1 it is:
* XXYYZZ, where XX=major, YY=minor, ZZ=release
*/ */
#define PNG_LIBPNG_VER 10636 /* 1.6.36 */ #define PNG_LIBPNG_VER 10636 /* 1.6.36 */
@ -2713,7 +2714,7 @@ typedef struct
* *
* When the simplified API needs to convert between sRGB and linear colorspaces, * When the simplified API needs to convert between sRGB and linear colorspaces,
* the actual sRGB transfer curve defined in the sRGB specification (see the * the actual sRGB transfer curve defined in the sRGB specification (see the
* article at https://en.wikipedia.org/wiki/SRGB) is used, not the gamma=1/2.2 * article at <https://en.wikipedia.org/wiki/SRGB>) is used, not the gamma=1/2.2
* approximation used elsewhere in libpng. * approximation used elsewhere in libpng.
* *
* When an alpha channel is present it is expected to denote pixel coverage * When an alpha channel is present it is expected to denote pixel coverage

View File

@ -1,11 +1,11 @@
Makefiles for libpng Makefiles for libpng
pnglibconf.h.prebuilt => Stores configuration settings pnglibconf.h.prebuilt => Configuration settings
makefile.linux => Linux/ELF makefile makefile.linux => Linux/ELF makefile
(gcc, creates libpng16.so.16.1.6.*) (gcc, creates shared libpng16.so.16.1.6.*)
makefile.linux-opt=> Linux/ELF makefile with hardware optimizations on makefile.linux-opt=> Linux/ELF makefile with hardware optimizations on
(gcc, creates libpng16.so.16.1.6.*) (gcc, creates shared libpng16.so.16.1.6.*)
makefile.gcc => Generic makefile (gcc, creates static libpng.a) makefile.gcc => Generic makefile (gcc, creates static libpng.a)
makefile.knr => Archaic UNIX Makefile that converts files with makefile.knr => Archaic UNIX Makefile that converts files with
ansi2knr (Requires ansi2knr.c from ansi2knr (Requires ansi2knr.c from
@ -15,10 +15,10 @@ pnglibconf.h.prebuilt => Stores configuration settings
makefile.amiga => Amiga makefile makefile.amiga => Amiga makefile
makefile.atari => Atari makefile makefile.atari => Atari makefile
makefile.bc32 => 32-bit Borland C++ (all modules compiled in C mode) makefile.bc32 => 32-bit Borland C++ (all modules compiled in C mode)
makefile.beos => beos makefile makefile.beos => BeOS makefile
makefile.bor => Borland makefile (uses bcc) makefile.bor => Borland makefile (uses bcc)
makefile.cegcc => minge32ce for Windows CE makefile makefile.cegcc => minge32ce for Windows CE makefile
makefile.darwin => Darwin makefile, can use on MacosX makefile.darwin => Darwin makefile, for macOS (formerly Mac OS X)
makefile.dec => DEC Alpha UNIX makefile makefile.dec => DEC Alpha UNIX makefile
makefile.dj2 => DJGPP 2 makefile makefile.dj2 => DJGPP 2 makefile
makefile.freebsd => FreeBSD makefile makefile.freebsd => FreeBSD makefile
@ -30,17 +30,17 @@ pnglibconf.h.prebuilt => Stores configuration settings
makefile.intel => Intel C/C++ version 4.0 and later makefile.intel => Intel C/C++ version 4.0 and later
makefile.mips => MIPS makefile makefile.mips => MIPS makefile
makefile.msc => Microsoft C makefile makefile.msc => Microsoft C makefile
makefile.netbsd => NetBSD/cc makefile, makes libpng.so. makefile.netbsd => NetBSD/cc makefile, makes shared libpng.so
makefile.openbsd => OpenBSD makefile makefile.openbsd => OpenBSD makefile
makefile.os2 => OS/2 Makefile (gcc and emx, requires libpng.def) makefile.os2 => OS/2 Makefile (gcc and emx, requires libpng.def)
makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc makefile.sco => SCO OSr5 ELF and Unixware 7 with Native cc
makefile.sggcc => Silicon Graphics makefile makefile.sggcc => Silicon Graphics makefile
(gcc, creates libpng16.so.16.1.6.*) (gcc, creates shared libpng16.so.16.1.6.*)
makefile.sgi => Silicon Graphics IRIX makefile (cc, creates static lib) makefile.sgi => Silicon Graphics IRIX makefile (cc, creates static lib)
makefile.solaris => Solaris 2.X makefile makefile.solaris => Solaris 2.X makefile
(gcc, creates libpng16.so.16.1.6.*) (gcc, creates shared libpng16.so.16.1.6.*)
makefile.so9 => Solaris 9 makefile makefile.so9 => Solaris 9 makefile
(gcc, creates libpng16.so.16.1.6.*) (gcc, creates shared libpng16.so.16.1.6.*)
makefile.std => Generic UNIX makefile (cc, creates static libpng.a) makefile.std => Generic UNIX makefile (cc, creates static libpng.a)
makefile.sunos => Sun makefile makefile.sunos => Sun makefile
makefile.32sunu => Sun Ultra 32-bit makefile makefile.32sunu => Sun Ultra 32-bit makefile
@ -57,7 +57,7 @@ Other supporting scripts:
libpng-config-body.in => used by several makefiles to create libpng-config libpng-config-body.in => used by several makefiles to create libpng-config
libpng-config-head.in => used by several makefiles to create libpng-config libpng-config-head.in => used by several makefiles to create libpng-config
libpng.pc.in => Used by several makefiles to create libpng.pc libpng.pc.in => Used by several makefiles to create libpng.pc
pngwin.rc => Used by the visualc71 project. pngwin.rc => Used by the visualc71 project
pngwin.def => Used by makefile.os2 pngwin.def => Used by makefile.os2
pngwin.dfn => Used to maintain pngwin.def pngwin.dfn => Used to maintain pngwin.def
SCOPTIONS.ppc => Used with smakefile.ppc SCOPTIONS.ppc => Used with smakefile.ppc