From a0ea87ffc6021ee744e03f4f11bef03c98a080ff Mon Sep 17 00:00:00 2001 From: Lucas CHOLLET Date: Fri, 4 Aug 2023 16:08:48 -0400 Subject: [PATCH] LibGfx/JPEGXL: Compute the position inside the channel correctly Turns out I only decoded square images until now, which make this code work. A bit ashamed to have written that bug. --- Userland/Libraries/LibGfx/ImageFormats/JPEGXLLoader.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibGfx/ImageFormats/JPEGXLLoader.cpp b/Userland/Libraries/LibGfx/ImageFormats/JPEGXLLoader.cpp index 8aa46e7c2b..17a09c0601 100644 --- a/Userland/Libraries/LibGfx/ImageFormats/JPEGXLLoader.cpp +++ b/Userland/Libraries/LibGfx/ImageFormats/JPEGXLLoader.cpp @@ -1508,12 +1508,12 @@ public: i32 get(u32 x, u32 y) const { - return m_pixels[x * m_width + y]; + return m_pixels[y * m_width + x]; } void set(u32 x, u32 y, i32 value) { - m_pixels[x * m_width + y] = value; + m_pixels[y * m_width + x] = value; } u32 width() const