mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Mention libpng in its internal warning and error messages
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -61,16 +61,16 @@ static std::vector<uint8_t> readInto(std::string const &path) {
|
||||
[[noreturn]]
|
||||
static void pngError(png_structp png, char const *msg) {
|
||||
fatal(
|
||||
"Error writing reversed image (\"%s\"): %s",
|
||||
static_cast<char const *>(png_get_error_ptr(png)),
|
||||
"libpng error while writing reversed image (\"%s\"): %s",
|
||||
reinterpret_cast<char const *>(png_get_error_ptr(png)),
|
||||
msg
|
||||
);
|
||||
}
|
||||
|
||||
static void pngWarning(png_structp png, char const *msg) {
|
||||
warnx(
|
||||
"While writing reversed image (\"%s\"): %s",
|
||||
static_cast<char const *>(png_get_error_ptr(png)),
|
||||
"libpng found while writing reversed image (\"%s\"): %s",
|
||||
reinterpret_cast<char const *>(png_get_error_ptr(png)),
|
||||
msg
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
FATAL: Error reading PNG image ("damaged1.png"): IDAT: invalid code -- missing end-of-block
|
||||
FATAL: libpng error while reading PNG image ("damaged1.png"): IDAT: invalid code -- missing end-of-block
|
||||
Conversion aborted after 1 error
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
FATAL: Error reading PNG image ("damaged2.png"): IDAT: invalid code -- missing end-of-block
|
||||
FATAL: libpng error while reading PNG image ("damaged2.png"): IDAT: invalid code -- missing end-of-block
|
||||
Conversion aborted after 1 error
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
FATAL: Error reading PNG image ("damaged9.png"): IDAT: invalid code -- missing end-of-block
|
||||
FATAL: libpng error while reading PNG image ("damaged9.png"): IDAT: invalid code -- missing end-of-block
|
||||
Conversion aborted after 1 error
|
||||
|
||||
Reference in New Issue
Block a user