mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-11-23 23:09:39 +03:00
Redirect libpng errors to the standard NetSurf logfile
svn path=/trunk/netsurf/; revision=12471
This commit is contained in:
parent
936baddaba
commit
91427fdfdb
19
image/png.c
19
image/png.c
@ -74,6 +74,23 @@ static unsigned int interlace_step[8] = {28, 28, 12, 12, 4, 4, 0};
|
||||
static unsigned int interlace_row_start[8] = {0, 0, 4, 0, 2, 0, 1};
|
||||
static unsigned int interlace_row_step[8] = {8, 8, 8, 4, 4, 2, 2};
|
||||
|
||||
/**
|
||||
* nspng_warning -- callback for libpng warnings
|
||||
*/
|
||||
void nspng_warning(png_structp png_ptr, png_const_charp warning_message)
|
||||
{
|
||||
LOG(("%s", warning_message));
|
||||
}
|
||||
|
||||
/**
|
||||
* nspng_error -- callback for libpng errors
|
||||
*/
|
||||
void nspng_error(png_structp png_ptr, png_const_charp error_message)
|
||||
{
|
||||
LOG(("%s", error_message));
|
||||
longjmp(png_ptr->jmpbuf, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* info_callback -- PNG header has been completely received, prepare to process
|
||||
* image data
|
||||
@ -209,6 +226,8 @@ static nserror nspng_create_png_data(nspng_content *png_c)
|
||||
return NSERROR_NOMEM;
|
||||
}
|
||||
|
||||
png_set_error_fn(png_c->png, NULL, nspng_error, nspng_warning);
|
||||
|
||||
png_c->info = png_create_info_struct(png_c->png);
|
||||
if (png_c->info == NULL) {
|
||||
png_destroy_read_struct(&png_c->png, &png_c->info, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user