From 92a3ef4a148af53c286defcb17b07352f90591b3 Mon Sep 17 00:00:00 2001 From: Glenn Randers-Pehrson Date: Wed, 31 Mar 2010 21:50:21 -0500 Subject: [PATCH] [devel] Combined multiple png_warning() calls for a single error. --- ANNOUNCE | 5 +++-- CHANGES | 3 ++- pngread.c | 19 +++++++++---------- pngrio.c | 7 +++---- pngrutil.c | 13 ++++++------- pngwio.c | 7 +++---- pngwrite.c | 23 +++++++++++------------ 7 files changed, 37 insertions(+), 40 deletions(-) diff --git a/ANNOUNCE b/ANNOUNCE index 345a71a47..ce54f401e 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -1,5 +1,5 @@ -Libpng 1.5.0beta16 - March 30, 2010 +Libpng 1.5.0beta16 - April 1, 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,7 @@ version 1.5.0beta15 [March 17, 2010] Removed makefile.mingw. Eliminated PNG_NO_EXTERN and PNG_ALL_EXTERN -version 1.5.0beta16 [March 30, 2010] +version 1.5.0beta16 [April 1, 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 @@ -139,6 +139,7 @@ version 1.5.0beta16 [March 30, 2010] 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.) + Combined multiple png_warning() calls for a single error. Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/CHANGES b/CHANGES index 495d8bf59..fb04654f8 100644 --- a/CHANGES +++ b/CHANGES @@ -2608,7 +2608,7 @@ version 1.5.0beta15 [March 17, 2010] Removed makefile.mingw. Eliminated PNG_NO_EXTERN and PNG_ALL_EXTERN -version 1.5.0beta16 [March 30, 2010] +version 1.5.0beta16 [April 1, 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 @@ -2616,6 +2616,7 @@ version 1.5.0beta16 [March 30, 2010] 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.) + Combined multiple png_warning() calls for a single error. Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/pngread.c b/pngread.c index 9238017a2..bb0fc3a8f 100644 --- a/pngread.c +++ b/pngread.c @@ -1,7 +1,7 @@ /* pngread.c - read a PNG file * - * Last changed in libpng 1.5.0 [March 17, 2010] + * Last changed in libpng 1.5.0 [April 1, 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.) @@ -127,21 +127,20 @@ png_create_read_struct_2(png_const_charp user_png_ver, png_voidp error_ptr, char msg[80]; if (user_png_ver) { - png_snprintf(msg, 80, - "Application was compiled with png.h from libpng-%.20s", - user_png_ver); + png_snprintf2(msg, 80, + "Application built with libpng-%.20s" + " but running with %.20s", + user_png_ver, + png_libpng_ver); png_warning(png_ptr, msg); } - png_snprintf(msg, 80, - "Application is running with png.c from libpng-%.20s", - png_libpng_ver); - png_warning(png_ptr, msg); +#else + png_warning(png_ptr, + "Incompatible libpng version in application and library"); #endif #ifdef PNG_ERROR_NUMBERS_SUPPORTED png_ptr->flags = 0; #endif - png_warning(png_ptr, - "Incompatible libpng version in application and library"); png_cleanup_needed = 1; } diff --git a/pngrio.c b/pngrio.c index bf232139f..555dcfeeb 100644 --- a/pngrio.c +++ b/pngrio.c @@ -1,7 +1,7 @@ /* pngrio.c - functions for data input * - * Last changed in libpng 1.5.0 [March 17, 2010] + * Last changed in libpng 1.5.0 [April 1, 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.) @@ -150,9 +150,8 @@ png_set_read_fn(png_structp png_ptr, png_voidp io_ptr, { png_ptr->write_data_fn = NULL; png_warning(png_ptr, - "It's an error to set both read_data_fn and write_data_fn in the "); - png_warning(png_ptr, - "same structure. Resetting write_data_fn to NULL"); + "Can't set both read_data_fn and write_data_fn in the" + " same structure"); } #ifdef PNG_WRITE_FLUSH_SUPPORTED diff --git a/pngrutil.c b/pngrutil.c index b54dca693..72bd01a35 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 30, 2010] + * Last changed in libpng 1.4.1 [April 1, 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.) @@ -1133,15 +1133,14 @@ png_handle_iCCP(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) { png_free(png_ptr, png_ptr->chunkdata); png_ptr->chunkdata = NULL; - png_warning(png_ptr, "Ignoring truncated iCCP profile"); #ifdef PNG_STDIO_SUPPORTED { - char umsg[50]; + char umsg[80]; - png_snprintf(umsg, 50, "declared profile size = %lu", - (unsigned long)profile_size); - png_warning(png_ptr, umsg); - png_snprintf(umsg, 50, "actual profile length = %lu", + png_snprintf2(umsg, 80, + "Ignoring iCCP chunk with declared size = %lu " + "and actual length = %lu", + (unsigned long)profile_size, (unsigned long)profile_length); png_warning(png_ptr, umsg); } diff --git a/pngwio.c b/pngwio.c index 83b7a49e0..b7735f3c3 100644 --- a/pngwio.c +++ b/pngwio.c @@ -1,7 +1,7 @@ /* pngwio.c - functions for data output * - * Last changed in libpng 1.5.0 [March 17, 2010] + * Last changed in libpng 1.5.0 [April 1, 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.) @@ -200,9 +200,8 @@ png_set_write_fn(png_structp png_ptr, png_voidp io_ptr, { png_ptr->read_data_fn = NULL; png_warning(png_ptr, - "Attempted to set both read_data_fn and write_data_fn in"); - png_warning(png_ptr, - "the same structure. Resetting read_data_fn to NULL"); + "Can't set both read_data_fn and write_data_fn in the" + " same structure"); } } diff --git a/pngwrite.c b/pngwrite.c index 002b1b2f7..5bffe9cf4 100644 --- a/pngwrite.c +++ b/pngwrite.c @@ -1,7 +1,7 @@ /* pngwrite.c - general routines to write a PNG file * - * Last changed in libpng 1.5.0 [March 17, 2010] + * Last changed in libpng 1.5.0 [April 1, 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.) @@ -541,21 +541,20 @@ png_create_write_struct_2(png_const_charp user_png_ver, png_voidp error_ptr, char msg[80]; if (user_png_ver) { - png_snprintf(msg, 80, - "Application was compiled with png.h from libpng-%.20s", - user_png_ver); - png_warning(png_ptr, msg); - } - png_snprintf(msg, 80, - "Application is running with png.c from libpng-%.20s", - png_libpng_ver); - png_warning(png_ptr, msg); + png_snprintf2(msg, 80, + "Application built with libpng-%.20s" + " but running with %.20s", + user_png_ver, + png_libpng_ver); + png_warning(png_ptr, msg); + } +#else + png_warning(png_ptr, + "Incompatible libpng version in application and library"); #endif #ifdef PNG_ERROR_NUMBERS_SUPPORTED png_ptr->flags = 0; #endif - png_warning(png_ptr, - "Incompatible libpng version in application and library"); png_cleanup_needed = 1; } } -- GitLab