[devel] Combined multiple png_warning() calls for a single error.

This commit is contained in:
Glenn Randers-Pehrson 2010-03-31 21:50:21 -05:00
parent 946c3f985f
commit 92a3ef4a14
7 changed files with 37 additions and 40 deletions

View File

@ -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 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.
@ -131,7 +131,7 @@ version 1.5.0beta15 [March 17, 2010]
Removed makefile.mingw. Removed makefile.mingw.
Eliminated PNG_NO_EXTERN and PNG_ALL_EXTERN 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 Make png_text_struct independent of PNG_iTXt_SUPPORTED, so that
fields are initialized in all configurations. The READ/WRITE fields are initialized in all configurations. The READ/WRITE
macros (PNG_(READ|WRITE)_iTXt_SUPPORTED) still function as 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 and iTXt_SUPPORTED can be used to detect presence of either
read or write support (but it is probably better to check for read or write support (but it is probably better to check for
the one actually required - read or write.) 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 Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit (subscription required; visit

View File

@ -2608,7 +2608,7 @@ version 1.5.0beta15 [March 17, 2010]
Removed makefile.mingw. Removed makefile.mingw.
Eliminated PNG_NO_EXTERN and PNG_ALL_EXTERN 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 Make png_text_struct independent of PNG_iTXt_SUPPORTED, so that
fields are initialized in all configurations. The READ/WRITE fields are initialized in all configurations. The READ/WRITE
macros (PNG_(READ|WRITE)_iTXt_SUPPORTED) still function as 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 and iTXt_SUPPORTED can be used to detect presence of either
read or write support (but it is probably better to check for read or write support (but it is probably better to check for
the one actually required - read or write.) 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 Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit (subscription required; visit

View File

@ -1,7 +1,7 @@
/* pngread.c - read a PNG file /* 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 * Copyright (c) 1998-2010 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.)
@ -127,21 +127,20 @@ png_create_read_struct_2(png_const_charp user_png_ver, png_voidp error_ptr,
char msg[80]; char msg[80];
if (user_png_ver) if (user_png_ver)
{ {
png_snprintf(msg, 80, png_snprintf2(msg, 80,
"Application was compiled with png.h from libpng-%.20s", "Application built with libpng-%.20s"
user_png_ver); " but running with %.20s",
png_warning(png_ptr, msg); user_png_ver,
}
png_snprintf(msg, 80,
"Application is running with png.c from libpng-%.20s",
png_libpng_ver); png_libpng_ver);
png_warning(png_ptr, msg); png_warning(png_ptr, msg);
}
#else
png_warning(png_ptr,
"Incompatible libpng version in application and library");
#endif #endif
#ifdef PNG_ERROR_NUMBERS_SUPPORTED #ifdef PNG_ERROR_NUMBERS_SUPPORTED
png_ptr->flags = 0; png_ptr->flags = 0;
#endif #endif
png_warning(png_ptr,
"Incompatible libpng version in application and library");
png_cleanup_needed = 1; png_cleanup_needed = 1;
} }

View File

@ -1,7 +1,7 @@
/* pngrio.c - functions for data input /* 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 * Copyright (c) 1998-2010 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.)
@ -150,9 +150,8 @@ png_set_read_fn(png_structp png_ptr, png_voidp io_ptr,
{ {
png_ptr->write_data_fn = NULL; png_ptr->write_data_fn = NULL;
png_warning(png_ptr, png_warning(png_ptr,
"It's an error to set both read_data_fn and write_data_fn in the "); "Can't set both read_data_fn and write_data_fn in the"
png_warning(png_ptr, " same structure");
"same structure. Resetting write_data_fn to NULL");
} }
#ifdef PNG_WRITE_FLUSH_SUPPORTED #ifdef PNG_WRITE_FLUSH_SUPPORTED

View File

@ -1,7 +1,7 @@
/* pngrutil.c - utilities to read a PNG file /* 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 * Copyright (c) 1998-2010 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.)
@ -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_free(png_ptr, png_ptr->chunkdata);
png_ptr->chunkdata = NULL; png_ptr->chunkdata = NULL;
png_warning(png_ptr, "Ignoring truncated iCCP profile");
#ifdef PNG_STDIO_SUPPORTED #ifdef PNG_STDIO_SUPPORTED
{ {
char umsg[50]; char umsg[80];
png_snprintf(umsg, 50, "declared profile size = %lu", png_snprintf2(umsg, 80,
(unsigned long)profile_size); "Ignoring iCCP chunk with declared size = %lu "
png_warning(png_ptr, umsg); "and actual length = %lu",
png_snprintf(umsg, 50, "actual profile length = %lu", (unsigned long)profile_size,
(unsigned long)profile_length); (unsigned long)profile_length);
png_warning(png_ptr, umsg); png_warning(png_ptr, umsg);
} }

View File

@ -1,7 +1,7 @@
/* pngwio.c - functions for data output /* 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 * Copyright (c) 1998-2010 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.)
@ -200,9 +200,8 @@ png_set_write_fn(png_structp png_ptr, png_voidp io_ptr,
{ {
png_ptr->read_data_fn = NULL; png_ptr->read_data_fn = NULL;
png_warning(png_ptr, png_warning(png_ptr,
"Attempted to set both read_data_fn and write_data_fn in"); "Can't set both read_data_fn and write_data_fn in the"
png_warning(png_ptr, " same structure");
"the same structure. Resetting read_data_fn to NULL");
} }
} }

View File

@ -1,7 +1,7 @@
/* pngwrite.c - general routines to write a PNG file /* 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 * Copyright (c) 1998-2010 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.)
@ -541,21 +541,20 @@ png_create_write_struct_2(png_const_charp user_png_ver, png_voidp error_ptr,
char msg[80]; char msg[80];
if (user_png_ver) if (user_png_ver)
{ {
png_snprintf(msg, 80, png_snprintf2(msg, 80,
"Application was compiled with png.h from libpng-%.20s", "Application built with libpng-%.20s"
user_png_ver); " but running with %.20s",
png_warning(png_ptr, msg); user_png_ver,
}
png_snprintf(msg, 80,
"Application is running with png.c from libpng-%.20s",
png_libpng_ver); png_libpng_ver);
png_warning(png_ptr, msg); png_warning(png_ptr, msg);
}
#else
png_warning(png_ptr,
"Incompatible libpng version in application and library");
#endif #endif
#ifdef PNG_ERROR_NUMBERS_SUPPORTED #ifdef PNG_ERROR_NUMBERS_SUPPORTED
png_ptr->flags = 0; png_ptr->flags = 0;
#endif #endif
png_warning(png_ptr,
"Incompatible libpng version in application and library");
png_cleanup_needed = 1; png_cleanup_needed = 1;
} }
} }