Browse Source

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.
Lucas CHOLLET 2 năm trước cách đây
mục cha
commit
a0ea87ffc6
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      Userland/Libraries/LibGfx/ImageFormats/JPEGXLLoader.cpp

+ 2 - 2
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