[libpng17] Changed user chunk callback API to respect global and per chunk

defaults.  Previously a return of 0 from a user chunk callback would result in
the chunk being saved (if this was safe, even if the chunk was unsafe-to-copy);
this change respects the defaults set by the application, so unknown chunks
can be discarded by default and known-safe ones preserved.
This commit is contained in:
John Bowler
2013-03-02 21:39:44 -06:00
committed by Glenn Randers-Pehrson
parent 6152dbd424
commit ec89aefb44
6 changed files with 68 additions and 63 deletions

View File

@@ -1,4 +1,4 @@
.TH LIBPNG 3 "February 27, 2013"
.TH LIBPNG 3 "March 3, 2013"
.SH NAME
libpng \- Portable Network Graphics (PNG) Reference Library 1.7.0beta05
.SH SYNOPSIS
@@ -494,7 +494,7 @@ Following is a copy of the libpng-manual.txt file that accompanies libpng.
.SH LIBPNG.TXT
libpng-manual.txt - A description on how to use and modify libpng
libpng version 1.7.0beta05 - February 27, 2013
libpng version 1.7.0beta05 - March 3, 2013
Updated and distributed by Glenn Randers-Pehrson
<glennrp at users.sourceforge.net>
Copyright (c) 1998-2013 Glenn Randers-Pehrson
@@ -505,7 +505,7 @@ libpng-manual.txt - A description on how to use and modify libpng
Based on:
libpng versions 0.97, January 1998, through 1.7.0beta05 - February 27, 2013
libpng versions 0.97, January 1998, through 1.7.0beta05 - March 3, 2013
Updated and distributed by Glenn Randers-Pehrson
Copyright (c) 1998-2013 Glenn Randers-Pehrson
@@ -1021,10 +1021,15 @@ you can retrieve with
png_get_user_chunk_ptr(png_ptr);
If you call the png_set_read_user_chunk_fn() function, then all unknown
chunks will be saved when read, in case your callback function will need
one or more of them. This behavior can be changed with the
png_set_keep_unknown_chunks() function, described below.
If you call the png_set_read_user_chunk_fn() function, then all unknown chunks
will be passed to your callback when read. You can cause known chunks to be
passed in as well by using png_set_keep_unknown_chunks (see below) - this will
prevent the normal libpng handling of those known chunks.
If your callback returns 0 the default unknown handling will be used (see
below). This is new behavior in libpng 1.7, prior to 1.7 it was not possible to
discard a chunk; PNG_HANDLE_CHUNK_IF_SAFE was forced. Libpng 1.6.0 issues a
warning when this was done.
At this point, you can set up a callback function that will be
called after each row has been read, which you can use to control
@@ -5682,7 +5687,7 @@ Other rules can be inferred by inspecting the libpng source.
.SH XVII. Y2K Compliance in libpng
February 27, 2013
March 3, 2013
Since the PNG Development group is an ad-hoc body, we can't make
an official declaration.
@@ -5952,7 +5957,7 @@ possible without all of you.
Thanks to Frank J. T. Wojcik for helping with the documentation.
Libpng version 1.7.0beta05 - February 27, 2013:
Libpng version 1.7.0beta05 - March 3, 2013:
Initially created in 1995 by Guy Eric Schalnat, then of Group 42, Inc.
Currently maintained by Glenn Randers-Pehrson (glennrp at users.sourceforge.net).
@@ -5975,7 +5980,7 @@ this sentence.
This code is released under the libpng license.
libpng versions 1.2.6, August 15, 2004, through 1.7.0beta05, February 27, 2013, are
libpng versions 1.2.6, August 15, 2004, through 1.7.0beta05, March 3, 2013, are
Copyright (c) 2004,2006-2007 Glenn Randers-Pehrson, and are
distributed according to the same disclaimer and license as libpng-1.2.5
with the following individual added to the list of Contributing Authors
@@ -6074,7 +6079,7 @@ certification mark of the Open Source Initiative.
Glenn Randers-Pehrson
glennrp at users.sourceforge.net
February 27, 2013
March 3, 2013
.\" end of man page