Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Tests/LibGfx/TestImageDecoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,6 @@ TEST_CASE(test_jbig2_decode)
// - immediate refinement regions referring to a direct region (code support added in #26197)
// - immediate refinement regions referring to a direct region (code support added in #26197)
// - TPGRON set in refinement region (only reachable in standalone refinement regions)
// - in embedded organization, reference from segment in one chunk to segment in another chunk
// Missing tests for things that aren't implemented yet:
// - immediate refinement regions not referring to a direct region (i.e. refining the page)
// - immediate lossless refinement regions
Expand Down
1 change: 1 addition & 0 deletions Tests/LibPDF/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ set(TEST_FILES
encryption_nocopy.pdf
group.pdf
jbig2-globals.pdf
jbig2-globals-indirect-reference.pdf
jpeg2000-indexed-small.pdf
linearized.pdf
non-linearized.pdf
Expand Down
15 changes: 14 additions & 1 deletion Tests/LibPDF/TestPDF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ TEST_CASE(encrypted_object_stream)

TEST_CASE(resolve_indirect_reference_during_parsing)
{
auto file = TRY_OR_FAIL(Core::MappedFile::map("jbig2-globals.pdf"sv));
auto file = TRY_OR_FAIL(Core::MappedFile::map("jbig2-globals-indirect-reference.pdf"sv));
auto document = MUST(PDF::Document::create(file->bytes()));
MUST(document->initialize());
EXPECT_EQ(document->get_page_count(), 1U);
Expand All @@ -141,6 +141,19 @@ TEST_CASE(resolve_indirect_reference_during_parsing)
EXPECT_EQ(jbig2_stream->bytes().size(), 20'000U);
}

TEST_CASE(jbig2_embedded_organization_cross_chunk_reference)
{
auto file = TRY_OR_FAIL(Core::MappedFile::map("jbig2-globals.pdf"sv));
auto document = MUST(PDF::Document::create(file->bytes()));
MUST(document->initialize());
EXPECT_EQ(document->get_page_count(), 1U);

auto page = MUST(document->get_page(0));
auto page_size = Gfx::IntSize { 399, 400 };
auto bitmap = TRY_OR_FAIL(Gfx::Bitmap::create(Gfx::BitmapFormat::BGRx8888, page_size));
MUST(PDF::Renderer::render(document, page, bitmap, Color::White, PDF::RenderingPreferences {}));
}

TEST_CASE(malformed_pdf_document)
{
Array test_inputs = {
Expand Down
Binary file added Tests/LibPDF/jbig2-globals-indirect-reference.pdf
Binary file not shown.
Binary file modified Tests/LibPDF/jbig2-globals.pdf
Binary file not shown.
Loading