IMAGE: Print source of callback messages. Change PNG warning into debug.

This commit is contained in:
Paweł Kołodziejski 2021-02-13 12:31:16 +01:00
parent 59ee9db798
commit 54c2b1aaec
2 changed files with 4 additions and 3 deletions

View File

@ -172,7 +172,7 @@ void errorExit(j_common_ptr cinfo) {
(*cinfo->err->format_message)(cinfo, buffer);
// This function is not allowed to return to the caller, thus we simply
// error out with our error handling here.
error("%s", buffer);
error("libjpeg: %s", buffer);
}
void outputMessage(j_common_ptr cinfo) {

View File

@ -34,6 +34,7 @@
#include "graphics/pixelformat.h"
#include "graphics/surface.h"
#include "common/debug.h"
#include "common/array.h"
#include "common/stream.h"
@ -73,11 +74,11 @@ Graphics::PixelFormat PNGDecoder::getByteOrderRgbaPixelFormat() const {
#ifdef USE_PNG
// libpng-error-handling:
void pngError(png_structp pngptr, png_const_charp errorMsg) {
error("%s", errorMsg);
error("libpng: %s", errorMsg);
}
void pngWarning(png_structp pngptr, png_const_charp warningMsg) {
warning("%s", warningMsg);
debug(3, "libpng: %s", warningMsg);
}
// libpng-I/O-helpers: