[libpng16] Reverted png_set_itxt(); it would not compile without warnings.

This commit is contained in:
Glenn Randers-Pehrson 2012-03-16 23:17:27 -05:00
parent 31d66245ea
commit 42ed02ed9a
7 changed files with 10 additions and 97 deletions

View File

@ -1,5 +1,5 @@
Libpng 1.6.0beta19 - March 16, 2012
Libpng 1.6.0beta19 - March 17, 2012
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.
@ -318,8 +318,7 @@ Version 1.6.0beta18 [March 16, 2012]
read benign errors to warnings (regardless of the system default, unless
this is disabled in which case the simplified API can't be built.)
Version 1.6.0beta19 [March 16, 2012]
Added png_set_itxt() (work in progress)
Version 1.6.0beta19 [March 17, 2012]
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit

View File

@ -4069,8 +4069,7 @@ Version 1.6.0beta18 [March 16, 2012]
read benign errors to warnings (regardless of the system default, unless
this is disabled in which case the simplified API can't be built.)
Version 1.6.0beta19 [March 16, 2012]
Added png_set_itxt() (work in progress)
Version 1.6.0beta19 [March 17, 2012]
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit

View File

@ -863,13 +863,6 @@ void write_png(char *file_name /* , ... other image information ... */)
*/
png_set_gAMA(png_ptr, info_ptr, gamma);
#if PNG_LIBPNG_VER >= 1.6.0
png_set_itxt(png_ptr, info_ptr, 0, 0, "Title", "Mona Lisa", NULL, NULL);
png_set_itxt(png_ptr, info_ptr, 0, 0, "Author", "Leonardo da Vinci", NULL,
NULL);
png_set_itxt(png_ptr, info_ptr, 3, 0, "Description", "<long text>", NULL,
NULL);
#else
/* Optionally write comments into the image */
{
png_text text_ptr[3];
@ -903,7 +896,6 @@ void write_png(char *file_name /* , ... other image information ... */)
png_set_text(write_ptr, write_info_ptr, text_ptr, 3);
}
#endif
/* Other optional chunks like cHRM, bKGD, tRNS, tIME, oFFs, pHYs */

19
png.h
View File

@ -1,7 +1,7 @@
/* png.h - header file for PNG reference library
*
* libpng version 1.6.0beta19 - March 16, 2012
* libpng version 1.6.0beta19 - March 17, 2012
* Copyright (c) 1998-2012 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
@ -11,7 +11,7 @@
* Authors and maintainers:
* libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat
* libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger
* libpng versions 0.97, January 1998, through 1.6.0beta19 - March 16, 2012: Glenn
* libpng versions 0.97, January 1998, through 1.6.0beta19 - March 17, 2012: Glenn
* See also "Contributing Authors", below.
*
* Note about libpng version numbers:
@ -198,7 +198,7 @@
*
* This code is released under the libpng license.
*
* libpng versions 1.2.6, August 15, 2004, through 1.6.0beta19, March 16, 2012, are
* libpng versions 1.2.6, August 15, 2004, through 1.6.0beta19, March 17, 2012, are
* Copyright (c) 2004, 2006-2012 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:
@ -310,7 +310,7 @@
* Y2K compliance in libpng:
* =========================
*
* March 16, 2012
* March 17, 2012
*
* Since the PNG Development group is an ad-hoc body, we can't make
* an official declaration.
@ -376,7 +376,7 @@
/* Version information for png.h - this should match the version in png.c */
#define PNG_LIBPNG_VER_STRING "1.6.0beta19"
#define PNG_HEADER_VERSION_STRING \
" libpng version 1.6.0beta19 - March 16, 2012\n"
" libpng version 1.6.0beta19 - March 17, 2012\n"
#define PNG_LIBPNG_VER_SONUM 16
#define PNG_LIBPNG_VER_DLLNUM 16
@ -2263,13 +2263,6 @@ PNG_EXPORT(163, void, png_set_text, (png_const_structrp png_ptr,
png_inforp info_ptr, png_const_textp text_ptr, int num_text));
#endif
#ifdef PNG_WRITE_TEXT_SUPPORTED
PNG_EXPORT(243, void, png_set_itxt, (png_const_structrp png_ptr,
png_inforp info_ptr, const int in_flag, const int in_method,
png_const_charp in_key, png_const_charp in_text, png_const_charp in_lang,
png_const_charp in_lang_key));
#endif
#ifdef PNG_tIME_SUPPORTED
PNG_EXPORT(164, png_uint_32, png_get_tIME, (png_const_structrp png_ptr,
png_inforp info_ptr, png_timep *mod_time));
@ -3088,7 +3081,7 @@ PNG_EXPORT(242, void, png_set_check_for_invalid_index,
* scripts/symbols.def as well.
*/
#ifdef PNG_EXPORT_LAST_ORDINAL
PNG_EXPORT_LAST_ORDINAL(243);
PNG_EXPORT_LAST_ORDINAL(242);
#endif
#ifdef __cplusplus

View File

@ -1410,75 +1410,6 @@ png_set_text_compression_method(png_structrp png_ptr, int method)
#endif /* PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED */
/* end of API added to libpng-1.5.4 */
#ifdef PNG_WRITE_TEXT_SUPPORTED
/* TO DO: synopsis in libpng.3
* revise example.c
* set up some macros to use instead of 0,1,2,3
* test, test, test
*/
/* API added to libpng-1.6.0 */
void PNGAPI
png_set_itxt(png_const_structrp png_ptr, png_inforp info_ptr,
const int in_flag, const int in_method, png_const_charp in_key,
png_const_charp in_text, png_const_charp in_lang,
png_const_charp in_lang_key)
{
if (png_ptr != NULL && info_ptr != NULL)
{
png_text text_ptr[1];
char *key = (png_charp) in_key;
char *text = (png_charp) in_text;
#ifdef PNG_WRITE_iTXt_SUPPORTED
char *lang = (png_charp) in_lang;
char *lang_key = (png_charp) in_lang_key;
#endif
text_ptr[0].key = key;
text_ptr[0].text = text;
#ifdef PNG_WRITE_iTXt_SUPPORTED
text_ptr[0].lang = lang;
text_ptr[0].lang_key = lang_key;
#endif
/*
TO DO: use macros for these.
-1: tEXt, none
0: zTXt, deflate
1: iTXt, none
2: iTXt, deflate
*/
if (in_method != 0)
png_benign_error(png_ptr,
"Only text compression method 0 is supported, using 0.");
if (in_flag == 0)
text_ptr[0].compression = -1;
else if (in_flag == 1)
text_ptr[0].compression = 0;
else if (in_flag == 2)
text_ptr[0].compression = 1;
else if (in_flag == 3)
text_ptr[0].compression = 2;
else
{
png_benign_error(png_ptr,
"Unrecognized text compression flag, using (compressed iTXt).");
text_ptr[0].compression = 2;
}
png_debug(1, "in png_set_itxt");
/* TO DO: fix compiler warning about discarding qualifier here */
png_set_text(png_ptr, info_ptr, text_ptr, 1);
}
}
#endif
void PNGAPI
png_set_write_status_fn(png_structrp png_ptr, png_write_status_ptr write_row_fn)
{

View File

@ -3,7 +3,7 @@
/* pnglibconf.h - library build configuration */
/* Libpng 1.6.0beta19 - March 16, 2012 */
/* Libpng 1.6.0beta19 - March 17, 2012 */
/* Copyright (c) 1998-2012 Glenn Randers-Pehrson */

View File

@ -248,4 +248,3 @@ EXPORTS
png_image_write_to_stdio @240
png_convert_to_rfc1123_buffer @241
png_set_check_for_invalid_index @242
png_set_itxt @243