From 286cc6f9059a84b4c4cd8eb3bfb83245f982722b Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Wed, 29 May 2024 18:24:41 -0400 Subject: [PATCH] LibGfx/WebPLoader: Prefix a few dbgln_if()s with chunk name --- Userland/Libraries/LibGfx/ImageFormats/WebPLoader.cpp | 8 ++++---- .../Libraries/LibGfx/ImageFormats/WebPLoaderLossless.cpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Userland/Libraries/LibGfx/ImageFormats/WebPLoader.cpp b/Userland/Libraries/LibGfx/ImageFormats/WebPLoader.cpp index c4c00b4e29..361fdddd00 100644 --- a/Userland/Libraries/LibGfx/ImageFormats/WebPLoader.cpp +++ b/Userland/Libraries/LibGfx/ImageFormats/WebPLoader.cpp @@ -124,7 +124,7 @@ static ErrorOr decode_webp_chunk_ALPH(RIFF::Chunk const& alph_chunk, Bitma u8 filtering_method = (flags >> 2) & 3; u8 compression_method = flags & 3; - dbgln_if(WEBP_DEBUG, "preprocessing {} filtering_method {} compression_method {}", preprocessing, filtering_method, compression_method); + dbgln_if(WEBP_DEBUG, "ALPH: preprocessing {} filtering_method {} compression_method {}", preprocessing, filtering_method, compression_method); ReadonlyBytes alpha_data = alph_chunk.data().slice(1); @@ -258,7 +258,7 @@ static ErrorOr decode_webp_chunk_VP8X(RIFF::Chunk const& vp8x_chunk) // 3 bytes height minus one u32 height = (vp8x_chunk[7] | (vp8x_chunk[8] << 8) | (vp8x_chunk[9] << 16)) + 1; - dbgln_if(WEBP_DEBUG, "flags {:#x} --{}{}{}{}{}{}, width {}, height {}", + dbgln_if(WEBP_DEBUG, "VP8X: flags {:#x} --{}{}{}{}{}{}, width {}, height {}", flags, has_icc ? " icc" : "", has_alpha ? " alpha" : "", @@ -281,7 +281,7 @@ static ErrorOr decode_webp_chunk_ANIM(RIFF::Chunk const& anim_chunk) u32 background_color = (u32)anim_chunk[0] | ((u32)anim_chunk[1] << 8) | ((u32)anim_chunk[2] << 16) | ((u32)anim_chunk[3] << 24); u16 loop_count = anim_chunk[4] | (anim_chunk[5] << 8); - dbgln_if(WEBP_DEBUG, "background_color {:x} loop_count {}", background_color, loop_count); + dbgln_if(WEBP_DEBUG, "ANIM: background_color {:x} loop_count {}", background_color, loop_count); return ANIMChunk { background_color, loop_count }; } @@ -314,7 +314,7 @@ static ErrorOr decode_webp_chunk_ANMF(WebPLoadingContext& context, RI auto blending_method = static_cast((flags >> 1) & 1); auto disposal_method = static_cast(flags & 1); - dbgln_if(WEBP_DEBUG, "frame_x {} frame_y {} frame_width {} frame_height {} frame_duration {} blending_method {} disposal_method {}", + dbgln_if(WEBP_DEBUG, "ANMF: frame_x {} frame_y {} frame_width {} frame_height {} frame_duration {} blending_method {} disposal_method {}", frame_x, frame_y, frame_width, frame_height, frame_duration, (int)blending_method, (int)disposal_method); // https://developers.google.com/speed/webp/docs/riff_container#assembling_the_canvas_from_frames diff --git a/Userland/Libraries/LibGfx/ImageFormats/WebPLoaderLossless.cpp b/Userland/Libraries/LibGfx/ImageFormats/WebPLoaderLossless.cpp index e5075e8bb9..7b094e2e02 100644 --- a/Userland/Libraries/LibGfx/ImageFormats/WebPLoaderLossless.cpp +++ b/Userland/Libraries/LibGfx/ImageFormats/WebPLoaderLossless.cpp @@ -40,7 +40,7 @@ ErrorOr decode_webp_chunk_VP8L_header(ReadonlyBytes vp8l_data) u8 version_number = TRY(bit_stream.read_bits(3)); VERIFY(bit_stream.is_eof()); - dbgln_if(WEBP_DEBUG, "width {}, height {}, is_alpha_used {}, version_number {}", + dbgln_if(WEBP_DEBUG, "VP8L: width {}, height {}, is_alpha_used {}, version_number {}", width, height, is_alpha_used, version_number); // "The version_number is a 3 bit code that must be set to 0. Any other value should be treated as an error."