Skip to content

Commit 31191fd

Browse files
committed
Log warnings from libpng when debug rendering is on
1 parent a6ed54e commit 31191fd

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

kitty/png-reader.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*/
77

88
#include "png-reader.h"
9+
#include "state.h"
910

1011

1112
struct fake_file { const uint8_t *buf; size_t sz, cur; };
@@ -35,8 +36,8 @@ read_png_error_handler(png_structp png_ptr, png_const_charp msg) {
3536
}
3637

3738
static void
38-
read_png_warn_handler(png_structp UNUSED png_ptr, png_const_charp UNUSED msg) {
39-
// ignore warnings
39+
read_png_warn_handler(png_structp UNUSED png_ptr, png_const_charp msg) {
40+
if (global_state.debug_rendering) log_error("libpng WARNING: %s", msg);
4041
}
4142

4243
#define ABRT(code, msg) { if(d->err_handler) d->err_handler(#code, msg); goto err; }

0 commit comments

Comments
 (0)