[
https://issues.apache.org/jira/browse/PDFBOX-5547?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17638487#comment-17638487
]
Tilman Hausherr commented on PDFBOX-5547:
-----------------------------------------
I found some really weird code at
https://github.com/openjdk-mirror/jdk7u-jdk/blob/master/src/share/classes/sun/awt/image/BufferedImageGraphicsConfig.java
this stores the graphics configuration per BufferedImage types, which makes no
sense re: bounds. This code shows the problem:
{code}
BufferedImage bim1 = new BufferedImage(100, 100, BufferedImage.TYPE_INT_RGB);
BufferedImage bim2 = new BufferedImage(200, 200, BufferedImage.TYPE_INT_RGB);
Graphics2D g1 = (Graphics2D) bim1.getGraphics();
Graphics2D g2 = (Graphics2D) bim2.getGraphics();
System.out.println("bounds1: " + g1.getDeviceConfiguration().getBounds());
System.out.println("bounds2: " + g2.getDeviceConfiguration().getBounds());
System.out.println("bounds1: " + g1.getDeviceConfiguration().getBounds());
{code}
the output is
{quote}
bounds1: java.awt.Rectangle[x=0,y=0,width=100,height=100]
bounds2: java.awt.Rectangle[x=0,y=0,width=100,height=100]
bounds1: java.awt.Rectangle[x=0,y=0,width=100,height=100]
{quote}
and it turns out it is a known bug
https://bugs.openjdk.org/browse/JDK-8072682
> Wrong rectangle in image with stencil
> -------------------------------------
>
> Key: PDFBOX-5547
> URL: https://issues.apache.org/jira/browse/PDFBOX-5547
> Project: PDFBox
> Issue Type: Bug
> Components: Rendering
> Affects Versions: 3.0.0 PDFBox
> Reporter: Tilman Hausherr
> Priority: Minor
> Attachments: PATTYP2.pdf-1.png, PATTYP2.pdf-1.png-diff.png,
> PDFBOX-5403-p1.pdf-1.png, PDFBOX-5403-p1.pdf-1.png-diff.png
>
>
> This is to track my efforts on a bug that has happened for years, but not
> very often, in my rendering regression tests.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]