mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-11-06 02:21:45 +00:00
* M2: a JBIG2 refinement reads 0 past its reference's width hayro-jbig2 keeps each row of a bitmap in 32-bit words and filled a new bitmap whole, so with a default pixel of 1 the bits past its width in each row's last word were 1s too. A refinement reads its reference a word at a time, those bits included, where ISO/IEC 14492 6.3.5.2 says a pixel outside the reference is 0. A refinement of the page, or of an intermediate text or halftone region, whose default pixel is 1 and whose width isn't a multiple of 32 decoded to other pixels than were coded. Vendored patch 13: Bitmap::clear_padding clears those bits when new_with or reinitialize fills a bitmap with 1s, as cutting symbols and patterns out of a collective bitmap already did. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AmsdeUCdTaD72jkDw2pJKY * M2: the doc on a JBIG2 bitmap's words says their padding is 0 Three places in hayro-jbig2 now clear the bits past a row's width, and the field's doc said only that rows are padded. It now says the padding is 0 and why: generic and refinement decoding read the rows above their own pixels a word at a time, as a refinement reads its reference, so whatever next writes whole words keeps it 0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AmsdeUCdTaD72jkDw2pJKY --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>