mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-12-04 04:52:54 -05:00
pdf_1_3_flattens_all_transparency_and_looks_the_same failed now and then because its transparency check searched the whole file for `/BM`. The file ID, written in the trailer and the XMP stream, is base64 that changes with the export time, so some exports had an ID that spells `/BM` and the check reported a blend mode in a flat file. The check now leaves out literal strings and stream data. A stream is found only by the whole `stream` keyword, not a name such as `/stream`, and its data is skipped by the stream dictionary's own `/Length`, read from the outermost dictionary and from its object when it is indirect. A length that does not end at `endstream`, or a stream with no `endstream`, fails the check. Every dictionary key it looked for is still checked. A new test covers an ID and an XMP packet that spell the keys, nested and escaped parentheses, `endstream` inside stream data, nested and indirect lengths, and wrong lengths. The helper comes from #10537.