ladybird/Tests/LibGfx
Nico Weber f8362c8abf LibGfx/JPEG2000: Remove an incorrect VERIFY in TagTree construction
...and add a test case that shows why it's incorrect.

If one dimension is 2^n + 1 and the other side is just 1, then the
topmost node will have 2^n x 1 and 1 x 1 children. The first child will
have n levels of children. The 1 x 1 child could end immediately, or it
could require that it also has n levels of (all 1 x 1) children. The
spec isn't clear on which of the two alternatives should happen. We
currently have n levels of 1 x 1 blocks.

This test case shows that a VERIFY we had was incorrect, so remove it.

The alternative implementation is to keep the VERIFY and to add a

    if (x_count == 1 && y_count == 1)
        level = 0;

to the top of TagTreeNode::create(). Then we don't have multiple levels
of 1 x 1 nodes, and we need to read fewer bits.

The images in the spec suggest that all nodes should have the same
number of levels, so go with that interpretation for now. Once we can
actually decode images, we'll hopefully see which of the two
interpretations is correct.

(The removed VERIFY() is hit when decoding
Tests/LibGfx/test-inputs/jpeg2000/buggie-gray.jpf in a local branch that
has some image decoding implemented. That file contains a packet with
1x3 code-blocks, which hits this case.)
2024-04-28 01:12:20 +02:00
..
test-inputs LibGfx/JBIG2: Support custom adaptive template pixels in refinement 2024-04-05 21:32:18 +02:00
BenchmarkGfxPainter.cpp Tests: Propagate errors with TRY_OR_FAIL() where possible 2024-02-14 17:46:06 -05:00
BenchmarkJPEGLoader.cpp Everywhere: Remove 'clang-format off' comments that are no longer needed 2024-04-24 16:50:01 -04:00
CMakeLists.txt LibGfx: Fix off-by-some in Painter::draw_scaled_bitmap_with_transform() 2024-01-10 09:38:13 +01:00
TestDeltaE.cpp LibGfx: Add DeltaE() function 2023-04-30 05:57:20 +02:00
TestFontHandling.cpp LibGfx: Allow extracting paths from fonts and add Gfx::Path::text() 2023-11-05 02:46:46 +01:00
TestGfxBitmap.cpp LibGfx: Fix serializing Gfx::Bitmaps 2023-10-15 20:34:29 +02:00
TestICCProfile.cpp LibGfx/ICC: Implement conversion between different connection spaces 2023-12-04 08:02:36 +00:00
TestImageDecoder.cpp LibGfx/JPEG2000: Remove an incorrect VERIFY in TagTree construction 2024-04-28 01:12:20 +02:00
TestPainter.cpp LibGfx: Clip out-of-bounds pixel accesses in Painter::draw_rect() 2024-04-14 18:05:48 +02:00
TestParseISOBMFF.cpp LibGfx: Add initial ISO BMFF parsing and a utility to print file info 2023-07-27 12:02:37 +01:00
TestRect.cpp LibGfx: Add Rect::unite_{horizontally,vertically}() 2023-07-13 05:09:08 +02:00
TestScalingFunctions.cpp LibGfx+Everywhere: Change Gfx::Rect to be endpoint exclusive 2023-05-23 12:35:42 +02:00
TestWOFF.cpp LibGfx/WOFF: Ensure header totalSfntSize matches expected value 2023-10-24 07:29:09 +02:00
TestWOFF2.cpp LibGfx/WOFF2: Ensure numTables is within expected range 2023-10-26 08:39:26 +02:00