1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 04:07:44 +00:00

LibPDF: Get inline image data from parser to renderer

We create a inline_image_end operator that has all the relevant data
in a synthetic StreamObject.

inline_image_end is still a RENDERER_TODO(), so no real behavior
change. (Previously we'd call only inline_image_begin, so string the
todo message is about is now a bit different. But no interesting
behavior change.)
This commit is contained in:
Nico Weber 2023-12-18 16:36:29 -05:00 committed by Andreas Kling
parent 3285502ec6
commit 022fce75a6
2 changed files with 19 additions and 5 deletions

View file

@ -591,9 +591,12 @@ PDFErrorOr<Vector<Operator>> Parser::parse_operators()
m_reader.consume_whitespace();
auto stream_bytes = m_reader.bytes().slice(stream_start, stream_end - stream_start);
// FIXME: Do more with inline images than just skipping them.
(void)map;
(void)stream_bytes;
Vector<Value> inline_image_args;
auto map_object = make_object<DictObject>(move(map));
inline_image_args.append(make_object<StreamObject>(move(map_object), MUST(ByteBuffer::copy(stream_bytes))));
operators.append(Operator(OperatorType::InlineImageEnd, move(inline_image_args)));
continue;
}
operators.append(Operator(operator_type, move(operator_args)));