diff --git a/ANNOUNCE b/ANNOUNCE index d74e3c737b20eafee6041ddc1e11028a45f2cb66..345a71a474426de1ccbf17def701401cc98454f8 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -1,5 +1,5 @@ -Libpng 1.5.0beta16 - March 17, 2010 +Libpng 1.5.0beta16 - March 30, 2010 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. @@ -131,7 +131,14 @@ version 1.5.0beta15 [March 17, 2010] Removed makefile.mingw. Eliminated PNG_NO_EXTERN and PNG_ALL_EXTERN -version 1.5.0beta16 [March 17, 2010] +version 1.5.0beta16 [March 30, 2010] + Make png_text_struct independent of PNG_iTXt_SUPPORTED, so that + fields are initialized in all configurations. The READ/WRITE + macros (PNG_(READ|WRITE)_iTXt_SUPPORTED) still function as + before to disable code to actually read or write iTXt chunks + and iTXt_SUPPORTED can be used to detect presence of either + read or write support (but it is probably better to check for + the one actually required - read or write.) Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/CHANGES b/CHANGES index 3e08e2cd6cfd251159b83ac52ba879dd95fcb065..495d8bf59bf2f85c232f5baddad02ecfcce04c06 100644 --- a/CHANGES +++ b/CHANGES @@ -2608,7 +2608,14 @@ version 1.5.0beta15 [March 17, 2010] Removed makefile.mingw. Eliminated PNG_NO_EXTERN and PNG_ALL_EXTERN -version 1.5.0beta16 [March 17, 2010] +version 1.5.0beta16 [March 30, 2010] + Make png_text_struct independent of PNG_iTXt_SUPPORTED, so that + fields are initialized in all configurations. The READ/WRITE + macros (PNG_(READ|WRITE)_iTXt_SUPPORTED) still function as + before to disable code to actually read or write iTXt chunks + and iTXt_SUPPORTED can be used to detect presence of either + read or write support (but it is probably better to check for + the one actually required - read or write.) Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/example.c b/example.c index 1825fcb8ff961b7162ccaaa761feb2b37061750d..09b864ef947cfa8ebfceef102e09ead71ddbeed8 100644 --- a/example.c +++ b/example.c @@ -2,7 +2,7 @@ #if 0 /* in case someone actually tries to compile this */ /* example.c - an example of using libpng - * Last changed in libpng 1.5.0 [March 17, 2010] + * Last changed in libpng 1.5.0 [March 30, 2010] * This file has been placed in the public domain by the authors. * Maintained 1998-2010 Glenn Randers-Pehrson * Maintained 1996, 1997 Andreas Dilger) @@ -676,17 +676,21 @@ void write_png(char *file_name /* , ... other image information ... */) text_ptr[0].key = "Title"; text_ptr[0].text = "Mona Lisa"; text_ptr[0].compression = PNG_TEXT_COMPRESSION_NONE; + text_ptr[0].itxt_length = 0; + text_ptr[0].lang = NULL; + text_ptr[0].lang_key = NULL; text_ptr[1].key = "Author"; text_ptr[1].text = "Leonardo DaVinci"; text_ptr[1].compression = PNG_TEXT_COMPRESSION_NONE; + text_ptr[1].itxt_length = 0; + text_ptr[1].lang = NULL; + text_ptr[1].lang_key = NULL; text_ptr[2].key = "Description"; text_ptr[2].text = ""; text_ptr[2].compression = PNG_TEXT_COMPRESSION_zTXt; -#ifdef PNG_iTXt_SUPPORTED - text_ptr[0].lang = NULL; - text_ptr[1].lang = NULL; + text_ptr[2].itxt_length = 0; text_ptr[2].lang = NULL; -#endif + text_ptr[2].lang_key = NULL; png_set_text(png_ptr, info_ptr, text_ptr, 3); /* Other optional chunks like cHRM, bKGD, tRNS, tIME, oFFs, pHYs */ diff --git a/png.h b/png.h index 91c4c28cba90a401bf585a56059b9798bd0c8f11..c704186be9a166268fc7000b2a6b14338d874f67 100644 --- a/png.h +++ b/png.h @@ -1,7 +1,7 @@ /* png.h - header file for PNG reference library * - * libpng version 1.5.0beta16 - March 17, 2010 + * libpng version 1.5.0beta16 - March 30, 2010 * Copyright (c) 1998-2010 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.5.0beta16 - March 17, 2010: Glenn + * libpng versions 0.97, January 1998, through 1.5.0beta16 - March 30, 2010: Glenn * See also "Contributing Authors", below. * * Note about libpng version numbers: @@ -170,7 +170,7 @@ * * This code is released under the libpng license. * - * libpng versions 1.2.6, August 15, 2004, through 1.5.0beta16, March 17, 2010, are + * libpng versions 1.2.6, August 15, 2004, through 1.5.0beta16, March 30, 2010, are * Copyright (c) 2004, 2006-2010 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: @@ -282,7 +282,7 @@ * Y2K compliance in libpng: * ========================= * - * March 17, 2010 + * March 30, 2010 * * Since the PNG Development group is an ad-hoc body, we can't make * an official declaration. @@ -346,7 +346,7 @@ /* Version information for png.h - this should match the version in png.c */ #define PNG_LIBPNG_VER_STRING "1.5.0beta16" #define PNG_HEADER_VERSION_STRING \ - " libpng version 1.5.0beta16 - March 17, 2010\n" + " libpng version 1.5.0beta16 - March 30, 2010\n" #define PNG_LIBPNG_VER_SONUM 15 #define PNG_LIBPNG_VER_DLLNUM 15 @@ -523,13 +523,11 @@ typedef struct png_text_struct png_charp text; /* comment, may be an empty string (ie "") or a NULL pointer */ png_size_t text_length; /* length of the text string */ -# ifdef PNG_iTXt_SUPPORTED png_size_t itxt_length; /* length of the itxt string */ png_charp lang; /* language code, 0-79 characters or a NULL pointer */ png_charp lang_key; /* keyword translated UTF-8 string, 0 or more chars or a NULL pointer */ -# endif } png_text; typedef png_text FAR * png_textp; typedef png_text FAR * FAR * png_textpp; diff --git a/pngpread.c b/pngpread.c index 6b9cf41ae87fa84f2a100107ce329645bfad4ece..3f2bcd51c716be2a87a7d0f57b20f8a04092a975 100644 --- a/pngpread.c +++ b/pngpread.c @@ -1,7 +1,7 @@ /* pngpread.c - read a png file in push mode * - * Last changed in libpng 1.5.0 [March 17, 2010] + * Last changed in libpng 1.5.0 [March 30, 2010] * Copyright (c) 1998-2010 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.) @@ -1235,10 +1235,9 @@ png_push_read_tEXt(png_structp png_ptr, png_infop info_ptr) png_sizeof(png_text)); text_ptr->compression = PNG_TEXT_COMPRESSION_NONE; text_ptr->key = key; -#ifdef PNG_iTXt_SUPPORTED + text_ptr->itxt_length = 0; text_ptr->lang = NULL; text_ptr->lang_key = NULL; -#endif text_ptr->text = text; ret = png_set_text_2(png_ptr, info_ptr, text_ptr, 1); @@ -1437,10 +1436,9 @@ png_push_read_zTXt(png_structp png_ptr, png_infop info_ptr) png_sizeof(png_text)); text_ptr->compression = PNG_TEXT_COMPRESSION_zTXt; text_ptr->key = key; -#ifdef PNG_iTXt_SUPPORTED + text_ptr->itxt_length = 0; text_ptr->lang = NULL; text_ptr->lang_key = NULL; -#endif text_ptr->text = text; ret = png_set_text_2(png_ptr, info_ptr, text_ptr, 1); diff --git a/pngrutil.c b/pngrutil.c index 19ac70c49632f36b7ac00f033017aca615d676ef..b54dca693dde873b232d3230bef84031892027d8 100644 --- a/pngrutil.c +++ b/pngrutil.c @@ -1,7 +1,7 @@ /* pngrutil.c - utilities to read a PNG file * - * Last changed in libpng 1.4.1 [March 17, 2010] + * Last changed in libpng 1.4.1 [March 30, 2010] * Copyright (c) 1998-2010 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.) @@ -2051,11 +2051,9 @@ png_handle_tEXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) } text_ptr->compression = PNG_TEXT_COMPRESSION_NONE; text_ptr->key = key; -#ifdef PNG_iTXt_SUPPORTED text_ptr->lang = NULL; text_ptr->lang_key = NULL; text_ptr->itxt_length = 0; -#endif text_ptr->text = text; text_ptr->text_length = png_strlen(text); @@ -2172,11 +2170,9 @@ png_handle_zTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) } text_ptr->compression = comp_type; text_ptr->key = png_ptr->chunkdata; -#ifdef PNG_iTXt_SUPPORTED text_ptr->lang = NULL; text_ptr->lang_key = NULL; text_ptr->itxt_length = 0; -#endif text_ptr->text = png_ptr->chunkdata + prefix_len; text_ptr->text_length = data_len; diff --git a/pngset.c b/pngset.c index 7e58169a00fc289e82afdde9149af73d1fd929de..76a47f5575d14f58dbe79a871e5ae1a48685ae57 100644 --- a/pngset.c +++ b/pngset.c @@ -1,7 +1,7 @@ /* pngset.c - storage of image information into info struct * - * Last changed in libpng 1.5.0 [March 17, 2010] + * Last changed in libpng 1.5.0 [March 30, 2010] * Copyright (c) 1998-2010 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.) @@ -697,8 +697,8 @@ png_set_text_2(png_structp png_ptr, png_infop info_ptr, png_textp text_ptr, lang_key_len = 0; } - else #ifdef PNG_iTXt_SUPPORTED + else { /* Set iTXt data */ @@ -747,7 +747,6 @@ png_set_text_2(png_structp png_ptr, png_infop info_ptr, png_textp text_ptr, png_memcpy(textp->key, text_ptr[i].key,(png_size_t)(key_len)); *(textp->key + key_len) = '\0'; -#ifdef PNG_iTXt_SUPPORTED if (text_ptr[i].compression > 0) { textp->lang = textp->key + key_len + 1; @@ -759,12 +758,9 @@ png_set_text_2(png_structp png_ptr, png_infop info_ptr, png_textp text_ptr, textp->text = textp->lang_key + lang_key_len + 1; } else -#endif { -#ifdef PNG_iTXt_SUPPORTED textp->lang=NULL; textp->lang_key=NULL; -#endif textp->text = textp->key + key_len + 1; } if (text_length) @@ -780,12 +776,9 @@ png_set_text_2(png_structp png_ptr, png_infop info_ptr, png_textp text_ptr, } else #endif - { textp->text_length = text_length; -#ifdef PNG_iTXt_SUPPORTED textp->itxt_length = 0; -#endif } info_ptr->num_text++; png_debug1(3, "transferred text chunk %d", info_ptr->num_text);