From 6c85f937efc2a86fdbf309c27bb0d83f5283c6de Mon Sep 17 00:00:00 2001 From: Lucas CHOLLET Date: Thu, 4 Jan 2024 20:14:06 -0500 Subject: [PATCH] LibGfx/JPEG: Print debug information on subsampling for each component --- Userland/Libraries/LibGfx/ImageFormats/JPEGLoader.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Userland/Libraries/LibGfx/ImageFormats/JPEGLoader.cpp b/Userland/Libraries/LibGfx/ImageFormats/JPEGLoader.cpp index 8594901dfa..38bdd34d93 100644 --- a/Userland/Libraries/LibGfx/ImageFormats/JPEGLoader.cpp +++ b/Userland/Libraries/LibGfx/ImageFormats/JPEGLoader.cpp @@ -1197,11 +1197,6 @@ static inline bool validate_luma_and_modify_context(Component const& luma, JPEGL context.hsample_factor = luma.hsample_factor; context.vsample_factor = luma.vsample_factor; - if constexpr (JPEG_DEBUG) { - dbgln("Horizontal Subsampling Factor: {}", luma.hsample_factor); - dbgln("Vertical Subsampling Factor: {}", luma.vsample_factor); - } - return true; } return false; @@ -1273,6 +1268,8 @@ static ErrorOr read_start_of_frame(JPEGStream& stream, JPEGLoadingContext& component.hsample_factor = subsample_factors >> 4; component.vsample_factor = subsample_factors & 0x0F; + dbgln_if(JPEG_DEBUG, "Component subsampling: {}, {}", component.hsample_factor, component.vsample_factor); + if (i == 0) { // By convention, downsampling is applied only on chroma components. So we should // hope to see the maximum sampling factor in the luma component.