Skip to content

Commit ad2bae7

Browse files
committedFeb 8, 2025·
LibGfx/JPEG2000: Support "predictable termination" code block style
Looks like this is more an encoder setting and does not need any code changes to the decoder.
1 parent d529c72 commit ad2bae7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed
 

‎Tests/LibGfx/TestImageDecoder.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -697,6 +697,7 @@ TEST_CASE(test_jpeg2000_decode)
697697
TEST_INPUT("jpeg2000/openjpeg-lossless-rgba-u8-prog0-tile3x2-cblk4x16-tp3-layers3-res2-mct.jp2"sv),
698698
TEST_INPUT("jpeg2000/jasper-rgba-u8-cbstyle-02-resetprob.jp2"sv),
699699
TEST_INPUT("jpeg2000/jasper-rgba-u8-cbstyle-08-vcausal.jp2"sv),
700+
TEST_INPUT("jpeg2000/jasper-rgba-u8-cbstyle-16-pterm.jp2"sv),
700701
TEST_INPUT("jpeg2000/jasper-rgba-u8-cbstyle-32-segsym.jp2"sv),
701702
TEST_INPUT("jpeg2000/jasper-tile3x2-res5.jp2"sv),
702703
TEST_INPUT("jpeg2000/openjpeg-lossless-rgba-u8-prog0-SOP.jp2"sv),
@@ -789,7 +790,6 @@ TEST_CASE(test_jpeg2000_decode_unsupported)
789790
Array test_inputs = {
790791
TEST_INPUT("jpeg2000/jasper-rgba-u8-cbstyle-01-bypass.jp2"sv),
791792
TEST_INPUT("jpeg2000/jasper-rgba-u8-cbstyle-04-termall.jp2"sv),
792-
TEST_INPUT("jpeg2000/jasper-rgba-u8-cbstyle-16-pterm.jp2"sv),
793793
TEST_INPUT("jpeg2000/jasper-rgba-u8-cbstyle-63-all.jp2"sv),
794794
TEST_INPUT("jpeg2000/kakadu-lossless-cmyk-u8-prog1-layers1-res6.jp2"sv),
795795
TEST_INPUT("jpeg2000/kakadu-lossless-cmyka-u8-prog1-layers1-res6.jp2"sv),

‎Userland/Libraries/LibGfx/ImageFormats/JPEG2000Loader.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1474,7 +1474,7 @@ static ErrorOr<u32> read_one_packet_header(JPEG2000LoadingContext& context, Tile
14741474
u32 const current_layer_index = progression_data.layer;
14751475

14761476
// FIXME: Relax. Will need implementing D.5, D.6, D.7, and probably more.
1477-
if ((coding_parameters.code_block_style & ~(0x20 | 8 | 2)) != 0)
1477+
if ((coding_parameters.code_block_style & ~(0x20 | 0x10 | 8 | 2)) != 0)
14781478
return Error::from_string_literal("JPEG2000ImageDecoderPlugin: Code-block style not yet implemented");
14791479

14801480
// B.10 Packet header information coding

0 commit comments

Comments
 (0)