1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 17:37:34 +00:00

LibPDF+LibGfx: Pass jbig2-filtered data to JBIG2ImageDecoderPlugin

Except for /JBIG2Globals, which we bail out on for now. In my 1000
files, 13 use JBIG2, and of those, 2 use JBIG2Globals (0000372.pdf e.g.
page 11 and 0000857.pdf e.g. page 1), and only one (the latter) of the
two uses the same JBIG2Globals stream for more than a single image.

JBIG2ImageDecoderPlugin cannot decode the data yet, so no behavior
change, but with `#define JBIG2_DEBUG 1` at the top of that file,
it now prints segment header info for PDFs containing JBIG2 data :^)
This commit is contained in:
Nico Weber 2024-03-03 21:05:53 -05:00 committed by Andreas Kling
parent bd60d1db7e
commit 953f6c5d9b
5 changed files with 26 additions and 5 deletions

View file

@ -25,6 +25,8 @@ public:
virtual ErrorOr<ImageFrameDescriptor> frame(size_t index, Optional<IntSize> ideal_size = {}) override;
static ErrorOr<ByteBuffer> decode_embedded(ReadonlyBytes);
private:
JBIG2ImageDecoderPlugin(ReadonlyBytes);