pdfbox-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Persson (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (PDFBOX-4306) Image clipping area rounding error
Date Fri, 31 Aug 2018 13:38:00 GMT

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

Daniel Persson commented on PDFBOX-4306:
----------------------------------------

Hi again.

We noticed that the result of smaller images in other pages created artifacts so we realized
that patch.diff was not a solution we could use going forward. 

Patch2.diff is a hackier solution but seems to solve the immediate problem for us at least
but there must be a better way.

best regards

Daniel

> Image clipping area rounding error
> ----------------------------------
>
>                 Key: PDFBOX-4306
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-4306
>             Project: PDFBox
>          Issue Type: Bug
>            Reporter: Daniel Persson
>            Priority: Major
>              Labels: rendering
>         Attachments: page-1.pdf, page-2.pdf, patch.diff, patch2.diff, test.jpg
>
>
> Creating images with PDFBox and merging them together when you have two pages that connect
will create a white line between the images.
> We have looked into the issue and tried to fix it and found that the clipping area is
a bit to tight so the images will not be rendered correctly. My guess is that this is due
to a rounding error when using floats. 
> Most of the graphics functions in java use double precision and PDFBox uses floats so
when using layer upon layer of bounding boxes intersecting the clipping area it might get
skewed to a bad bounding box.
> I've added a patch to this issue with the code we use as a workaround today. It's by
no means the final solution to the problem but it resolves the white line issue.
> To be sure that you get the error when generating the images use the following command
> ```
> java -jar pdfbox-app-3.0.0-SNAPSHOT.jar PDFToImage -dpi 150 -quality 0.95 -format jpg
page-1.pdf
> ```
> We run java 8 on our machines.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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


Mime
View raw message