[libpng16] Restored png_get_eXIf() and png_set_eXIf() to maintain API compatability.

This commit is contained in:
Glenn Randers-Pehrson 2017-08-02 16:48:11 -05:00
parent f8de55da04
commit 7c709f039f
9 changed files with 82 additions and 37 deletions

View File

@ -1,4 +1,4 @@
Libpng 1.6.32beta04 - August 2, 2017 Libpng 1.6.32beta05 - August 2, 2017
This is not intended to be a public release. It will be replaced This is not intended to be a public release. It will be replaced
within a few weeks by a public version or by another test version. within a few weeks by a public version or by another test version.
@ -8,20 +8,20 @@ Files available for download:
Source files with LF line endings (for Unix/Linux) and with a Source files with LF line endings (for Unix/Linux) and with a
"configure" script "configure" script
1.6.32beta04.tar.xz (LZMA-compressed, recommended) 1.6.32beta05.tar.xz (LZMA-compressed, recommended)
1.6.32beta04.tar.gz 1.6.32beta05.tar.gz
Source files with CRLF line endings (for Windows), without the Source files with CRLF line endings (for Windows), without the
"configure" script "configure" script
lp1632b04.7z (LZMA-compressed, recommended) lp1632b05.7z (LZMA-compressed, recommended)
lp1632b04.zip lp1632b05.zip
Other information: Other information:
1.6.32beta04-README.txt 1.6.32beta05-README.txt
1.6.32beta04-LICENSE.txt 1.6.32beta05-LICENSE.txt
libpng-1.6.32beta04-*.asc (armored detached GPG signatures) libpng-1.6.32beta05-*.asc (armored detached GPG signatures)
Changes since the last public release (1.6.31): Changes since the last public release (1.6.31):
@ -45,6 +45,11 @@ Version 1.6.32beta03 [August 2, 2017]
(Bug report from the OSS-fuzz project). (Bug report from the OSS-fuzz project).
Version 1.6.32beta04 [August 2, 2017] Version 1.6.32beta04 [August 2, 2017]
Replaced local eXIf_buf with info_ptr-eXIf_buf in png_handle_eXIf().
Update libpng.3 and libpng-manual.txt about eXIf functions.
Version 1.6.32beta05 [August 2, 2017]
Restored png_get_eXIf() and png_set_eXIf() to maintain API compatability.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit (subscription required; visit

View File

@ -5928,6 +5928,11 @@ Version 1.6.32beta03 [August 2, 2017]
(Bug report from the OSS-fuzz project). (Bug report from the OSS-fuzz project).
Version 1.6.32beta04 [August 2, 2017] Version 1.6.32beta04 [August 2, 2017]
Replaced local eXIf_buf with info_ptr-eXIf_buf in png_handle_eXIf().
Update libpng.3 and libpng-manual.txt about eXIf functions.
Version 1.6.32beta05 [August 2, 2017]
Restored png_get_eXIf() and png_set_eXIf() to maintain API compatability.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit (subscription required; visit

View File

@ -1,6 +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.32beta04 - August 2, 2017 libpng version 1.6.32beta05 - August 2, 2017
Updated and distributed by Glenn Randers-Pehrson Updated and distributed by Glenn Randers-Pehrson
<glennrp at users.sourceforge.net> <glennrp at users.sourceforge.net>
Copyright (c) 1998-2017 Glenn Randers-Pehrson Copyright (c) 1998-2017 Glenn Randers-Pehrson
@ -11,7 +11,7 @@ libpng-manual.txt - A description on how to use and modify libpng
Based on: Based on:
libpng versions 0.97, January 1998, through 1.6.32beta04 - August 2, 2017 libpng versions 0.97, January 1998, through 1.6.32beta05 - August 2, 2017
Updated and distributed by Glenn Randers-Pehrson Updated and distributed by Glenn Randers-Pehrson
Copyright (c) 1998-2017 Glenn Randers-Pehrson Copyright (c) 1998-2017 Glenn Randers-Pehrson
@ -1453,6 +1453,8 @@ png_set_rgb_to_gray()).
the single transparent color for the single transparent color for
non-paletted images (PNG_INFO_tRNS) non-paletted images (PNG_INFO_tRNS)
png_get_eXIf(png_ptr, info_ptr, &exif);
png_get_eXIf_1(png_ptr, info_ptr, &num_exif, &exif); png_get_eXIf_1(png_ptr, info_ptr, &num_exif, &exif);
(PNG_INFO_eXIf) (PNG_INFO_eXIf)
@ -3103,6 +3105,8 @@ width, height, bit_depth, and color_type must be the same in each call.
single transparent color for single transparent color for
non-paletted images (PNG_INFO_tRNS) non-paletted images (PNG_INFO_tRNS)
png_set_eXIf(png_ptr, info_ptr, exif);
png_set_eXIf_1(png_ptr, info_ptr, num_exif, exif); png_set_eXIf_1(png_ptr, info_ptr, num_exif, exif);
exif - Exif profile (array of exif - Exif profile (array of
@ -5404,7 +5408,7 @@ Since the PNG Development group is an ad-hoc body, we can't make
an official declaration. an official declaration.
This is your unofficial assurance that libpng from version 0.71 and This is your unofficial assurance that libpng from version 0.71 and
upward through 1.6.32beta04 are Y2K compliant. It is my belief that earlier upward through 1.6.32beta05 are Y2K compliant. It is my belief that earlier
versions were also Y2K compliant. versions were also Y2K compliant.
Libpng only has two year fields. One is a 2-byte unsigned integer Libpng only has two year fields. One is a 2-byte unsigned integer

View File

@ -1,6 +1,6 @@
.TH LIBPNG 3 "August 2, 2017" .TH LIBPNG 3 "August 2, 2017"
.SH NAME .SH NAME
libpng \- Portable Network Graphics (PNG) Reference Library 1.6.32beta04 libpng \- Portable Network Graphics (PNG) Reference Library 1.6.32beta05
.SH SYNOPSIS .SH SYNOPSIS
\fB \fB
#include <png.h>\fP #include <png.h>\fP
@ -97,6 +97,8 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.6.32beta04
\fBpng_byte png_get_header_version (png_const_structp \fIpng_ptr\fP\fB);\fP \fBpng_byte png_get_header_version (png_const_structp \fIpng_ptr\fP\fB);\fP
\fBpng_uint_32 png_get_eXIf (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fP\fIinfo_ptr\fP\fB, png_bytep \fI*exif\fP\fB);\fP
\fBpng_uint_32 png_get_eXIf_1 (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fP\fInum_exif\fP\fB, png_bytep \fI*exif\fP\fB);\fP \fBpng_uint_32 png_get_eXIf_1 (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fP\fInum_exif\fP\fB, png_bytep \fI*exif\fP\fB);\fP
\fBpng_uint_32 png_get_hIST (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fP\fIinfo_ptr\fP\fB, png_uint_16p \fI*hist\fP\fB);\fP \fBpng_uint_32 png_get_hIST (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fP\fIinfo_ptr\fP\fB, png_uint_16p \fI*hist\fP\fB);\fP
@ -349,6 +351,8 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.6.32beta04
\fBvoid png_set_gray_to_rgb (png_structp \fIpng_ptr\fP\fB);\fP \fBvoid png_set_gray_to_rgb (png_structp \fIpng_ptr\fP\fB);\fP
\fBvoid png_set_eXIf (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_bytep \fIexif\fP\fB);\fP
\fBvoid png_set_eXIf_1 (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fP\fInum_exif\fP\fB, png_bytep \fIexif\fP\fB);\fP \fBvoid png_set_eXIf_1 (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fP\fInum_exif\fP\fB, png_bytep \fIexif\fP\fB);\fP
\fBvoid png_set_hIST (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_16p \fIhist\fP\fB);\fP \fBvoid png_set_hIST (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_16p \fIhist\fP\fB);\fP
@ -514,7 +518,7 @@ 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.32beta04 - August 2, 2017 libpng version 1.6.32beta05 - August 2, 2017
Updated and distributed by Glenn Randers-Pehrson Updated and distributed by Glenn Randers-Pehrson
<glennrp at users.sourceforge.net> <glennrp at users.sourceforge.net>
Copyright (c) 1998-2017 Glenn Randers-Pehrson Copyright (c) 1998-2017 Glenn Randers-Pehrson
@ -525,7 +529,7 @@ libpng-manual.txt - A description on how to use and modify libpng
Based on: Based on:
libpng versions 0.97, January 1998, through 1.6.32beta04 - August 2, 2017 libpng versions 0.97, January 1998, through 1.6.32beta05 - August 2, 2017
Updated and distributed by Glenn Randers-Pehrson Updated and distributed by Glenn Randers-Pehrson
Copyright (c) 1998-2017 Glenn Randers-Pehrson Copyright (c) 1998-2017 Glenn Randers-Pehrson
@ -1967,6 +1971,8 @@ png_set_rgb_to_gray()).
the single transparent color for the single transparent color for
non-paletted images (PNG_INFO_tRNS) non-paletted images (PNG_INFO_tRNS)
png_get_eXIf(png_ptr, info_ptr, &exif);
png_get_eXIf_1(png_ptr, info_ptr, &num_exif, &exif); png_get_eXIf_1(png_ptr, info_ptr, &num_exif, &exif);
(PNG_INFO_eXIf) (PNG_INFO_eXIf)
@ -3617,6 +3623,8 @@ width, height, bit_depth, and color_type must be the same in each call.
single transparent color for single transparent color for
non-paletted images (PNG_INFO_tRNS) non-paletted images (PNG_INFO_tRNS)
png_set_eXIf(png_ptr, info_ptr, exif);
png_set_eXIf_1(png_ptr, info_ptr, num_exif, exif); png_set_eXIf_1(png_ptr, info_ptr, num_exif, exif);
exif - Exif profile (array of exif - Exif profile (array of
@ -5918,7 +5926,7 @@ Since the PNG Development group is an ad-hoc body, we can't make
an official declaration. an official declaration.
This is your unofficial assurance that libpng from version 0.71 and This is your unofficial assurance that libpng from version 0.71 and
upward through 1.6.32beta04 are Y2K compliant. It is my belief that earlier upward through 1.6.32beta05 are Y2K compliant. It is my belief that earlier
versions were also Y2K compliant. versions were also Y2K compliant.
Libpng only has two year fields. One is a 2-byte unsigned integer Libpng only has two year fields. One is a 2-byte unsigned integer
@ -6076,7 +6084,7 @@ 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.32beta04 - August 2, 2017: Libpng version 1.6.32beta05 - August 2, 2017:
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.
Currently maintained by Glenn Randers-Pehrson (glennrp at users.sourceforge.net). Currently maintained by Glenn Randers-Pehrson (glennrp at users.sourceforge.net).
@ -6101,7 +6109,7 @@ this sentence.
This code is released under the libpng license. This code is released under the libpng license.
libpng versions 1.0.7, July 1, 2000 through 1.6.32beta04, August 2, 2017 are libpng versions 1.0.7, July 1, 2000 through 1.6.32beta05, August 2, 2017 are
Copyright (c) 2000-2002, 2004, 2006-2017 Glenn Randers-Pehrson, are Copyright (c) 2000-2002, 2004, 2006-2017 Glenn Randers-Pehrson, are
derived from libpng-1.0.6, and are distributed according to the same 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 disclaimer and license as libpng-1.0.6 with the following individuals

26
png.h
View File

@ -1,7 +1,7 @@
/* png.h - header file for PNG reference library /* png.h - header file for PNG reference library
* *
* libpng version 1.6.32beta04, August 2, 2017 * libpng version 1.6.32beta05, August 2, 2017
* *
* Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
@ -12,7 +12,7 @@
* Authors and maintainers: * Authors and maintainers:
* libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat * libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat
* libpng versions 0.89, June 1996, through 0.96, May 1997: Andreas Dilger * libpng versions 0.89, June 1996, through 0.96, May 1997: Andreas Dilger
* libpng versions 0.97, January 1998, through 1.6.32beta04, August 2, 2017: * libpng versions 0.97, January 1998, through 1.6.32beta05, August 2, 2017:
* Glenn Randers-Pehrson. * Glenn Randers-Pehrson.
* See also "Contributing Authors", below. * See also "Contributing Authors", below.
*/ */
@ -25,7 +25,7 @@
* *
* This code is released under the libpng license. * This code is released under the libpng license.
* *
* libpng versions 1.0.7, July 1, 2000 through 1.6.32beta04, August 2, 2017 are * libpng versions 1.0.7, July 1, 2000 through 1.6.32beta05, August 2, 2017 are
* Copyright (c) 2000-2002, 2004, 2006-2017 Glenn Randers-Pehrson, are * Copyright (c) 2000-2002, 2004, 2006-2017 Glenn Randers-Pehrson, are
* derived from libpng-1.0.6, and are distributed according to the same * 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 * disclaimer and license as libpng-1.0.6 with the following individuals
@ -247,7 +247,7 @@
* an official declaration. * an official declaration.
* *
* This is your unofficial assurance that libpng from version 0.71 and * This is your unofficial assurance that libpng from version 0.71 and
* upward through 1.6.32beta04 are Y2K compliant. It is my belief that * upward through 1.6.32beta05 are Y2K compliant. It is my belief that
* earlier versions were also Y2K compliant. * earlier versions were also Y2K compliant.
* *
* Libpng only has two year fields. One is a 2-byte unsigned integer * Libpng only has two year fields. One is a 2-byte unsigned integer
@ -309,8 +309,8 @@
*/ */
/* Version information for png.h - this should match the version in png.c */ /* Version information for png.h - this should match the version in png.c */
#define PNG_LIBPNG_VER_STRING "1.6.32beta04" #define PNG_LIBPNG_VER_STRING "1.6.32beta05"
#define PNG_HEADER_VERSION_STRING " libpng version 1.6.32beta04 - August 2, 2017\n" #define PNG_HEADER_VERSION_STRING " libpng version 1.6.32beta05 - August 2, 2017\n"
#define PNG_LIBPNG_VER_SONUM 16 #define PNG_LIBPNG_VER_SONUM 16
#define PNG_LIBPNG_VER_DLLNUM 16 #define PNG_LIBPNG_VER_DLLNUM 16
@ -324,7 +324,7 @@
* PNG_LIBPNG_VER_STRING, omitting any leading zero: * PNG_LIBPNG_VER_STRING, omitting any leading zero:
*/ */
#define PNG_LIBPNG_VER_BUILD 04 #define PNG_LIBPNG_VER_BUILD 05
/* Release Status */ /* Release Status */
#define PNG_LIBPNG_BUILD_ALPHA 1 #define PNG_LIBPNG_BUILD_ALPHA 1
@ -459,7 +459,7 @@ extern "C" {
/* This triggers a compiler error in png.c, if png.c and png.h /* This triggers a compiler error in png.c, if png.c and png.h
* do not agree upon the version number. * do not agree upon the version number.
*/ */
typedef char* png_libpng_version_1_6_32beta04; typedef char* png_libpng_version_1_6_32beta05;
/* Basic control structions. Read libpng-manual.txt or libpng.3 for more info. /* Basic control structions. Read libpng-manual.txt or libpng.3 for more info.
* *
@ -2010,9 +2010,13 @@ PNG_FIXED_EXPORT(233, void, png_set_cHRM_XYZ_fixed, (png_const_structrp png_ptr,
#endif #endif
#ifdef PNG_eXIf_SUPPORTED #ifdef PNG_eXIf_SUPPORTED
PNG_EXPORT(246, png_uint_32, png_get_eXIf_1, (png_const_structrp png_ptr, PNG_EXPORT(246, png_uint_32, png_get_eXIf, (png_const_structrp png_ptr,
png_inforp info_ptr, png_bytep *exif));
PNG_EXPORT(247, void, png_set_eXIf, (png_const_structrp png_ptr,
png_inforp info_ptr, const png_bytep exif));
PNG_EXPORT(248, png_uint_32, png_get_eXIf_1, (png_const_structrp png_ptr,
png_inforp info_ptr, png_uint_32 *num_exif, png_bytep *exif)); png_inforp info_ptr, png_uint_32 *num_exif, png_bytep *exif));
PNG_EXPORT(247, void, png_set_eXIf_1, (png_const_structrp png_ptr, PNG_EXPORT(249, void, png_set_eXIf_1, (png_const_structrp png_ptr,
png_inforp info_ptr, png_uint_32 num_exif, const png_bytep exif)); png_inforp info_ptr, png_uint_32 num_exif, const png_bytep exif));
#endif #endif
@ -3259,7 +3263,7 @@ PNG_EXPORT(244, int, png_set_option, (png_structrp png_ptr, int option,
* one to use is one more than this.) * one to use is one more than this.)
*/ */
#ifdef PNG_EXPORT_LAST_ORDINAL #ifdef PNG_EXPORT_LAST_ORDINAL
PNG_EXPORT_LAST_ORDINAL(247); PNG_EXPORT_LAST_ORDINAL(249);
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -774,6 +774,14 @@ png_get_sPLT(png_const_structrp png_ptr, png_inforp info_ptr,
#endif #endif
#ifdef PNG_eXIf_SUPPORTED #ifdef PNG_eXIf_SUPPORTED
png_uint_32 PNGAPI
png_get_eXIf(png_const_structrp png_ptr, png_inforp info_ptr,
png_bytep *exif)
{
png_uint_32 num_exif = (png_uint_32) strlen((char *) exif);
return (png_get_eXIf_1(png_ptr, info_ptr, &num_exif, exif));
}
png_uint_32 PNGAPI png_uint_32 PNGAPI
png_get_eXIf_1(png_const_structrp png_ptr, png_inforp info_ptr, png_get_eXIf_1(png_const_structrp png_ptr, png_inforp info_ptr,
png_uint_32 *num_exif, png_bytep *exif) png_uint_32 *num_exif, png_bytep *exif)

View File

@ -135,6 +135,14 @@ png_set_cHRM_XYZ(png_const_structrp png_ptr, png_inforp info_ptr, double red_X,
#endif /* cHRM */ #endif /* cHRM */
#ifdef PNG_eXIf_SUPPORTED #ifdef PNG_eXIf_SUPPORTED
void PNGAPI
png_set_eXIf(png_const_structrp png_ptr, png_inforp info_ptr,
const png_bytep eXIf_buf)
{
png_set_eXIf_1(png_ptr, info_ptr, (png_uint_32)strlen((char *)eXIf_buf),
(const png_bytep) eXIf_buf);
}
void PNGAPI void PNGAPI
png_set_eXIf_1(png_const_structrp png_ptr, png_inforp info_ptr, png_set_eXIf_1(png_const_structrp png_ptr, png_inforp info_ptr,
const png_uint_32 num_exif, const png_bytep eXIf_buf) const png_uint_32 num_exif, const png_bytep eXIf_buf)

View File

@ -1201,15 +1201,16 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
#ifdef PNG_READ_eXIf_SUPPORTED #ifdef PNG_READ_eXIf_SUPPORTED
{ {
png_bytep exif=NULL; png_bytep exif=NULL;
png_uint_32 exif_length; size_t exif_length;
if (png_get_eXIf_1(read_ptr, read_info_ptr, &exif_length, &exif) != 0) if (png_get_eXIf(read_ptr, read_info_ptr, &exif) != 0)
{ {
exif_length=strlen((const char *)exif);
if (exif_length > 1) if (exif_length > 1)
printf(" eXIf type %c%c, %d bytes\n",exif[0],exif[1], printf(" eXIf type %c%c, %lu bytes\n",exif[0],exif[1],
(int)exif_length); exif_length);
# ifdef PNG_WRITE_eXIf_SUPPORTED # ifdef PNG_WRITE_eXIf_SUPPORTED
png_set_eXIf_1(write_ptr, write_info_ptr, exif_length, exif); png_set_eXIf(write_ptr, write_info_ptr, exif);
# endif # endif
} }
} }
@ -2130,4 +2131,4 @@ main(void)
#endif #endif
/* Generate a compiler error if there is an old png.h in the search path. */ /* Generate a compiler error if there is an old png.h in the search path. */
typedef png_libpng_version_1_6_32beta04 Your_png_h_is_not_version_1_6_32beta04; typedef png_libpng_version_1_6_32beta05 Your_png_h_is_not_version_1_6_32beta05;

View File

@ -1,4 +1,4 @@
;Version 1.6.32beta04 ;Version 1.6.32beta05
;-------------------------------------------------------------- ;--------------------------------------------------------------
; LIBPNG symbol list as a Win32 DEF file ; LIBPNG symbol list as a Win32 DEF file
; Contains all the symbols that can be exported from libpng ; Contains all the symbols that can be exported from libpng
@ -250,5 +250,7 @@ EXPORTS
png_get_palette_max @243 png_get_palette_max @243
png_set_option @244 png_set_option @244
png_image_write_to_memory @245 png_image_write_to_memory @245
png_get_eXIf_1 @246 png_get_eXIf @246
png_set_eXIf_1 @247 png_set_eXIf @247
png_get_eXIf_1 @248
png_set_eXIf_1 @249