[ 
https://issues.apache.org/jira/browse/PDFBOX-6156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18055212#comment-18055212
 ] 

Tilman Hausherr commented on PDFBOX-6156:
-----------------------------------------

While working on a simple BitBlit, I noticed that setPixel() could not set a 0 
pixel, I have fixed that.

> 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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to