Skip to content

Commit

Permalink
Log warnings from libpng when debug rendering is on
Browse files Browse the repository at this point in the history
  • Loading branch information
kovidgoyal committed Aug 12, 2020
1 parent a6ed54e commit 31191fd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions kitty/png-reader.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/

#include "png-reader.h"
#include "state.h"


struct fake_file { const uint8_t *buf; size_t sz, cur; };
Expand Down Expand Up @@ -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; }
Expand Down

0 comments on commit 31191fd

Please sign in to comment.