From 9eab8734fe43c1209acc04f76e6c02a9f4d3b4ec Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 15 Apr 2019 23:47:42 +0200 Subject: [PATCH] PNGLoader: Disable debug spam. --- SharedGraphics/PNGLoader.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/SharedGraphics/PNGLoader.cpp b/SharedGraphics/PNGLoader.cpp index a4928c45e1..f44d1f281d 100644 --- a/SharedGraphics/PNGLoader.cpp +++ b/SharedGraphics/PNGLoader.cpp @@ -394,9 +394,11 @@ static bool process_IHDR(const ByteBuffer& data, PNGLoadingContext& context) ASSERT_NOT_REACHED(); } +#ifdef PNG_DEBUG printf("PNG: %dx%d (%d bpp)\n", context.width, context.height, context.bit_depth); printf(" Color type: %b\n", context.color_type); printf(" Interlace type: %b\n", context.interlace_method); +#endif context.decompression_buffer_size = (context.width * context.height * context.bytes_per_pixel + context.height); context.decompression_buffer = (byte*)mmap(nullptr, context.decompression_buffer_size, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, 0, 0); @@ -432,7 +434,9 @@ static bool process_chunk(Streamer& streamer, PNGLoadingContext& context) printf("Bail at chunk_crc\n"); return false; } +#ifdef PNG_DEBUG printf("Chunk type: '%s', size: %u, crc: %x\n", chunk_type, chunk_size, chunk_crc); +#endif if (!strcmp((const char*)chunk_type, "IHDR")) return process_IHDR(chunk_data, context);