From 31191fd48cea74293120213956a3cd203026bc87 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 12 Aug 2020 06:21:14 +0530 Subject: [PATCH] Log warnings from libpng when debug rendering is on --- kitty/png-reader.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kitty/png-reader.c b/kitty/png-reader.c index 04450860558..93910f0cfe9 100644 --- a/kitty/png-reader.c +++ b/kitty/png-reader.c @@ -6,6 +6,7 @@ */ #include "png-reader.h" +#include "state.h" 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) { } static void -read_png_warn_handler(png_structp UNUSED png_ptr, png_const_charp UNUSED msg) { - // ignore warnings +read_png_warn_handler(png_structp UNUSED png_ptr, png_const_charp msg) { + if (global_state.debug_rendering) log_error("libpng WARNING: %s", msg); } #define ABRT(code, msg) { if(d->err_handler) d->err_handler(#code, msg); goto err; }