ladybird/Userland/Libraries/LibGfx/ImageFormats
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
..
ISOBMFF LibGfx/JPEG2000: Support jpx extended 'colr' boxes 2024-03-30 10:01:07 +01:00
BMPLoader.cpp LibGfx/BMP: Clear alpha in palette entries 2024-03-05 21:27:41 +00:00
BMPLoader.h
BMPWriter.cpp Everywhere: Use east const in more places 2024-04-19 06:31:19 -04:00
BMPWriter.h
BooleanDecoder.cpp
BooleanDecoder.h
CCITTDecoder.cpp LibGfx/CCITT: Add PDF-specific options for CCITT3 1D 2024-03-19 12:22:28 +01:00
CCITTDecoder.h LibGfx/CCITT: Add PDF-specific options for CCITT3 1D 2024-03-19 12:22:28 +01:00
DDSLoader.cpp Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
DDSLoader.h AK: Rename GenericTraits to DefaultTraits 2023-11-09 10:05:51 -05:00
ExifOrientedBitmap.h LibGfx/ExifOrientedBitmap: Add support for CMYKBitmap 2024-01-24 22:16:22 -07:00
GIFLoader.cpp LibGfx/GIF: Avoid a silly loop in GIF logical screen parsing 2024-01-05 13:20:00 +01:00
GIFLoader.h
ICOLoader.cpp LibGfx/ICO: Remove unused parameter 2024-02-14 06:56:03 +01:00
ICOLoader.h LibGfx/ICO: Remove unused parameter 2024-02-14 06:56:03 +01:00
ILBMLoader.cpp LibGfx/ILBMLoader: Properly display images with a bitplane mask 2024-01-18 13:59:17 +01:00
ILBMLoader.h
ImageDecoder.cpp LibGfx: Add the start of a JPEG2000 loader 2024-03-25 20:35:00 +01:00
ImageDecoder.h LibGfx+Fallout: Make ImageDecoder return ErrorOr 2024-03-07 11:20:06 -05:00
JBIG2Loader.cpp LibGfx: Move QMArithmeticDecoder to its own file 2024-04-19 10:59:11 +02:00
JBIG2Loader.h LibGfx: Move QMArithmeticDecoder to its own file 2024-04-19 10:59:11 +02:00
JPEG2000Loader.cpp LibGfx/JPEG2000: Remove an incorrect VERIFY in TagTree construction 2024-04-28 01:12:20 +02:00
JPEG2000Loader.h LibGfx/JPEG2000: Implement tag trees 2024-04-16 00:40:16 +02:00
JPEGLoader.cpp LibGfx/JPEG: Add a comment to inverse_dct_8x8() 2024-03-23 09:40:29 +01:00
JPEGLoader.h LibGfx/JPEG: Expose the Exif metadata 2024-01-22 20:16:32 -07:00
JPEGShared.h
JPEGWriter.cpp LibGfx/JPEGWriter: Make it possible to write CMYKBitmaps 2024-02-02 07:19:18 +01:00
JPEGWriter.h LibGfx/JPEGWriter: Make it possible to write CMYKBitmaps 2024-02-02 07:19:18 +01:00
JPEGWriterTables.h
JPEGXLLoader.cpp LibGfx/ExifOrientedBitmap: Add support for CMYKBitmap 2024-01-24 22:16:22 -07:00
JPEGXLLoader.h
PAMLoader.cpp LibGfx/PNM: Remove unnecessary line 2024-01-26 14:53:33 +01:00
PAMLoader.h LibGFX/PAM: Allow reading CMYK .pam files 2024-01-26 07:36:53 +01:00
PBMLoader.cpp LibGfx/PNM: Remove unnecessary line 2024-01-26 14:53:33 +01:00
PBMLoader.h
PGMLoader.cpp LibGfx/PNM: Remove unnecessary line 2024-01-26 14:53:33 +01:00
PGMLoader.h
PNGLoader.cpp LibGfx/PNG: Spec comment for PNGImageDecoderPlugin::unfilter_scanline() 2024-01-15 23:42:45 +01:00
PNGLoader.h LibGfx: Make unfilter_scanline() a static PNGImageDecoderPlugin method 2023-11-17 19:09:50 +01:00
PNGShared.h LibGfx+LibPDF: Create filter_type() for converting u8 to FilterType 2023-11-17 19:09:50 +01:00
PNGWriter.cpp
PNGWriter.h
PortableFormatWriter.cpp
PortableFormatWriter.h
PortableImageLoaderCommon.h LibGfx/PNM: Remove two fixmes 2024-02-02 08:26:40 +00:00
PortableImageMapLoader.h LibGFX/PAM: Allow reading CMYK .pam files 2024-01-26 07:36:53 +01:00
PPMLoader.cpp LibGfx/PNM: Remove unnecessary line 2024-01-26 14:53:33 +01:00
PPMLoader.h
QMArithmeticDecoder.cpp LibGfx: Move QMArithmeticDecoder to its own file 2024-04-19 10:59:11 +02:00
QMArithmeticDecoder.h LibGfx: Add a comment to QMArithmeticDecoder.h 2024-04-19 10:59:11 +02:00
QOILoader.cpp
QOILoader.h AK: Rename GenericTraits to DefaultTraits 2023-11-09 10:05:51 -05:00
QOIWriter.cpp
QOIWriter.h
TGALoader.cpp LibGfx/TGA: Move a variable closer to its use 2024-03-08 08:38:31 +01:00
TGALoader.h LibGfx: Make validate_before_create() create a regular bool 2024-03-08 08:38:31 +01:00
TIFFLoader.cpp LibGfx/TIFF: Prevent recursion when following IFD pointers 2024-04-07 06:45:38 +02:00
TIFFLoader.h LibGfx/TIFF: Add an alternative entry point to only request metadata 2024-01-22 20:16:32 -07:00
TinyVGLoader.cpp LibGfx: Simplify path storage and tidy up APIs 2024-03-18 07:09:37 +01:00
TinyVGLoader.h LibGfx+ImageViewer: Replace ImageDecoder::is_vector() with an enum 2024-01-10 09:39:00 +01:00
WebPLoader.cpp Everywhere: Prefer {:#x} over 0x{:x} in format strings 2024-02-21 17:54:38 +01:00
WebPLoader.h
WebPLoaderLossless.cpp LibGfx/WebP: Remove a bounds check that is never hit 2024-04-15 15:53:52 +02:00
WebPLoaderLossless.h
WebPLoaderLossy.cpp
WebPLoaderLossy.h
WebPLoaderLossyTables.h Everywhere: Use east const in more places 2024-04-19 06:31:19 -04:00