Skip to content

Commit

Permalink
LibPDF: Pass the EncodedByteAligned option to the Group4 decoder
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasChollet committed Feb 16, 2025
1 parent 70a159a commit f699b2f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Userland/Libraries/LibPDF/Filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -314,13 +314,14 @@ PDFErrorOr<ByteBuffer> Filter::decode_ccitt(ReadonlyBytes bytes, RefPtr<DictObje
damaged_rows_before_error = decode_parms->get_value(CommonNames::DamagedRowsBeforeError).get<int>();
}

if (require_end_of_line || (encoded_byte_align && k != 0) || damaged_rows_before_error > 0)
if (require_end_of_line || damaged_rows_before_error > 0)
return Error::rendering_unsupported_error("Unimplemented option for the CCITTFaxDecode Filter");

ByteBuffer decoded {};
if (k < 0) {
Gfx::CCITT::Group4Options options {
.has_end_of_block = end_of_block ? Gfx::CCITT::Group4Options::HasEndOfBlock::Yes : Gfx::CCITT::Group4Options::HasEndOfBlock::No
.has_end_of_block = end_of_block ? Gfx::CCITT::Group4Options::HasEndOfBlock::Yes : Gfx::CCITT::Group4Options::HasEndOfBlock::No,
.encoded_byte_aligned = encoded_byte_align ? Gfx::CCITT::EncodedByteAligned::Yes : Gfx::CCITT::EncodedByteAligned::No,
};
decoded = TRY(Gfx::CCITT::decode_ccitt_group4(bytes, columns, rows, options));
} else if (k == 0) {
Expand Down

0 comments on commit f699b2f

Please sign in to comment.