mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-11-01 14:08:23 -06:00
Review of the previous commit: - Nothing checked the segment numbers the region split assigns: a mutant numbering every region 2 decoded. The many-marks test now reads each segment's number, and has a bar too tall to be a symbol, so the generic region is numbered after the last text region. - The decoder's 32,767-symbol limit was checked against all distinct marks, before either plan, so an image with more distinct marks lost the second plan, which codes only the repeated ones. The limit now applies to each plan (MAX_CODED_SYMBOLS); finding marks keeps its memory bound of 65,536 (MAX_SYMBOLS), as before the previous commit. A test has 32,768 distinct marks above a page of repeated text, which encode_jbig2 still symbol codes through the second plan. - The dense-page optimizer test now checks that it takes several text regions, and a compile-time assert keeps segment numbers within a byte's reach. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P6yUtvWGPsJpMLyh6pxSXG