Skip to content

Instantly share code, notes, and snippets.

@springmeyer
Created June 6, 2011 19:28
Show Gist options
  • Save springmeyer/1010903 to your computer and use it in GitHub Desktop.
Save springmeyer/1010903 to your computer and use it in GitHub Desktop.
/* This function is called when there is a warning, but the library thinks
* it can continue anyway. Replacement functions don't have to do anything
* here if you don't want to. In the default configuration, png_ptr is
* not used, but it is passed in case it may be useful.
*/
static void PNGCBAPI
pngtest_warning(png_structp png_ptr, png_const_charp message)
{
PNG_CONST char *name = "UNKNOWN (ERROR!)";
char *test;
test = png_get_error_ptr(png_ptr);
if (test == NULL)
fprintf(STDERR, "%s: libpng warning: %s\n", name, message);
else
fprintf(STDERR, "%s: libpng warning: %s\n", test, message);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment