You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Tilman Hausherr (Jira)" <ji...@apache.org> on 2026/01/29 15:45:00 UTC

[jira] [Updated] (PDFBOX-6156) RegionBitmap bit blit slightly too large

     [ https://issues.apache.org/jira/browse/PDFBOX-6156?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tilman Hausherr updated PDFBOX-6156:
------------------------------------
    Summary: RegionBitmap bit blit slightly too large  (was: RegionBitmap blitd slightly too large)

> RegionBitmap bit blit slightly too large
> ----------------------------------------
>
>                 Key: PDFBOX-6156
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-6156
>             Project: PDFBox
>          Issue Type: Sub-task
>          Components: JBIG2
>    Affects Versions: 3.0.4 JBIG2
>            Reporter: Tilman Hausherr
>            Priority: Major
>         Attachments: bitmap-composite-and-xnor.pdf, bitmap-composite-and-xnor.png
>
>
> The result rendering looks like this:
>  !bitmap-composite-and-xnor.png! 
> The XNOR is detected and works properly, the real cause is that we have a white region (on the left) that has the width 141, but the actual width after the blt operation is 144. It turns out that 144 is a multiple of 8 so {{Bitmaps.blit()}} botches the last byte somehow.
> Another thing I learned while working on this is that in the specification, 0 is white and 1 is black. The page starts with default 1 = all black. So the chaos starts when the next region image (on the right) is blited at x=141 with XNOR on the white stripe, resulting in a black stripe.
> 141 pixels = 17 bytes + 5 bits => 3 bits of the destination should be left untouched at the end.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org