Mention libpng in its internal warning and error messages

This commit is contained in:
Rangi
2025-10-06 17:03:51 -04:00
parent 02c2408f58
commit cca3794dd0
5 changed files with 17 additions and 13 deletions
+10 -6
View File
@@ -31,15 +31,19 @@ struct Input {
[[noreturn]]
static void handleError(png_structp png, char const *msg) {
Input const &input = *reinterpret_cast<Input *>(png_get_error_ptr(png));
fatal("Error reading PNG image (\"%s\"): %s", input.filename, msg);
fatal(
"libpng error while reading PNG image (\"%s\"): %s",
reinterpret_cast<Input *>(png_get_error_ptr(png))->filename,
msg
);
}
static void handleWarning(png_structp png, char const *msg) {
Input const &input = *reinterpret_cast<Input *>(png_get_error_ptr(png));
warnx("In PNG image (\"%s\"): %s", input.filename, msg);
warnx(
"libpng found while reading PNG image (\"%s\"): %s",
reinterpret_cast<Input *>(png_get_error_ptr(png))->filename,
msg
);
}
static void readData(png_structp png, png_bytep data, size_t length) {