[libpng16] Reverted png_set_itxt(); it would not compile without warnings.
This commit is contained in:
parent
31d66245ea
commit
42ed02ed9a
5
ANNOUNCE
5
ANNOUNCE
@ -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
|
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.
|
||||||
@ -318,8 +318,7 @@ Version 1.6.0beta18 [March 16, 2012]
|
|||||||
read benign errors to warnings (regardless of the system default, unless
|
read benign errors to warnings (regardless of the system default, unless
|
||||||
this is disabled in which case the simplified API can't be built.)
|
this is disabled in which case the simplified API can't be built.)
|
||||||
|
|
||||||
Version 1.6.0beta19 [March 16, 2012]
|
Version 1.6.0beta19 [March 17, 2012]
|
||||||
Added png_set_itxt() (work in progress)
|
|
||||||
|
|
||||||
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
|
||||||
|
3
CHANGES
3
CHANGES
@ -4069,8 +4069,7 @@ Version 1.6.0beta18 [March 16, 2012]
|
|||||||
read benign errors to warnings (regardless of the system default, unless
|
read benign errors to warnings (regardless of the system default, unless
|
||||||
this is disabled in which case the simplified API can't be built.)
|
this is disabled in which case the simplified API can't be built.)
|
||||||
|
|
||||||
Version 1.6.0beta19 [March 16, 2012]
|
Version 1.6.0beta19 [March 17, 2012]
|
||||||
Added png_set_itxt() (work in progress)
|
|
||||||
|
|
||||||
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
|
||||||
|
@ -863,13 +863,6 @@ void write_png(char *file_name /* , ... other image information ... */)
|
|||||||
*/
|
*/
|
||||||
png_set_gAMA(png_ptr, info_ptr, gamma);
|
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 */
|
/* Optionally write comments into the image */
|
||||||
{
|
{
|
||||||
png_text text_ptr[3];
|
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);
|
png_set_text(write_ptr, write_info_ptr, text_ptr, 3);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Other optional chunks like cHRM, bKGD, tRNS, tIME, oFFs, pHYs */
|
/* Other optional chunks like cHRM, bKGD, tRNS, tIME, oFFs, pHYs */
|
||||||
|
|
||||||
|
19
png.h
19
png.h
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
/* png.h - header file for PNG reference library
|
/* 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
|
* Copyright (c) 1998-2012 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||||
@ -11,7 +11,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.89c, June 1996, through 0.96, May 1997: Andreas Dilger
|
* 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.
|
* See also "Contributing Authors", below.
|
||||||
*
|
*
|
||||||
* Note about libpng version numbers:
|
* Note about libpng version numbers:
|
||||||
@ -198,7 +198,7 @@
|
|||||||
*
|
*
|
||||||
* This code is released under the libpng license.
|
* 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
|
* Copyright (c) 2004, 2006-2012 Glenn Randers-Pehrson, and are
|
||||||
* distributed according to the same disclaimer and license as libpng-1.2.5
|
* distributed according to the same disclaimer and license as libpng-1.2.5
|
||||||
* with the following individual added to the list of Contributing Authors:
|
* with the following individual added to the list of Contributing Authors:
|
||||||
@ -310,7 +310,7 @@
|
|||||||
* Y2K compliance in libpng:
|
* Y2K compliance in libpng:
|
||||||
* =========================
|
* =========================
|
||||||
*
|
*
|
||||||
* March 16, 2012
|
* March 17, 2012
|
||||||
*
|
*
|
||||||
* Since the PNG Development group is an ad-hoc body, we can't make
|
* Since the PNG Development group is an ad-hoc body, we can't make
|
||||||
* an official declaration.
|
* an official declaration.
|
||||||
@ -376,7 +376,7 @@
|
|||||||
/* 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.0beta19"
|
#define PNG_LIBPNG_VER_STRING "1.6.0beta19"
|
||||||
#define PNG_HEADER_VERSION_STRING \
|
#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_SONUM 16
|
||||||
#define PNG_LIBPNG_VER_DLLNUM 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));
|
png_inforp info_ptr, png_const_textp text_ptr, int num_text));
|
||||||
#endif
|
#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
|
#ifdef PNG_tIME_SUPPORTED
|
||||||
PNG_EXPORT(164, png_uint_32, png_get_tIME, (png_const_structrp png_ptr,
|
PNG_EXPORT(164, png_uint_32, png_get_tIME, (png_const_structrp png_ptr,
|
||||||
png_inforp info_ptr, png_timep *mod_time));
|
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.
|
* scripts/symbols.def as well.
|
||||||
*/
|
*/
|
||||||
#ifdef PNG_EXPORT_LAST_ORDINAL
|
#ifdef PNG_EXPORT_LAST_ORDINAL
|
||||||
PNG_EXPORT_LAST_ORDINAL(243);
|
PNG_EXPORT_LAST_ORDINAL(242);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
69
pngwrite.c
69
pngwrite.c
@ -1410,75 +1410,6 @@ png_set_text_compression_method(png_structrp png_ptr, int method)
|
|||||||
#endif /* PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED */
|
#endif /* PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED */
|
||||||
/* end of API added to libpng-1.5.4 */
|
/* 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
|
void PNGAPI
|
||||||
png_set_write_status_fn(png_structrp png_ptr, png_write_status_ptr write_row_fn)
|
png_set_write_status_fn(png_structrp png_ptr, png_write_status_ptr write_row_fn)
|
||||||
{
|
{
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
/* pnglibconf.h - library build configuration */
|
/* 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 */
|
/* Copyright (c) 1998-2012 Glenn Randers-Pehrson */
|
||||||
|
|
||||||
|
@ -248,4 +248,3 @@ EXPORTS
|
|||||||
png_image_write_to_stdio @240
|
png_image_write_to_stdio @240
|
||||||
png_convert_to_rfc1123_buffer @241
|
png_convert_to_rfc1123_buffer @241
|
||||||
png_set_check_for_invalid_index @242
|
png_set_check_for_invalid_index @242
|
||||||
png_set_itxt @243
|
|
||||||
|
Loading…
Reference in New Issue
Block a user