[
https://issues.apache.org/jira/browse/PDFBOX-3181?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15081432#comment-15081432
]
Tilman Hausherr commented on PDFBOX-3181:
-----------------------------------------
The javadoc tells:
{quote}
The returned BufferedImage shares the same data array as the original image.
{quote}
Some debug output:
{quote}
alphaRaster: ByteInterleavedRaster: width = 171 height = 142 #numDataElements 1
dataOff\[0] = 2752
image size: 171 142
alphaRaster sample size: 343 284
{quote}
Don't know why I used {{alphaRaster.getSampleModel().getHeight()}} instead of
{{alphaRaster.getHeight()}} in 2014, maybe copy and paste programming, although
I don't see an "inspiration URL" in the code, which I usually add.
Please test your code again with a -SNAPSHOT version and reopen if it doesn't
work.
> java.lang.ArrayIndexOutOfBoundsException: Coordinate out of bounds! in
> org.apache.pdfbox.pdmodel.graphics.image.LosslessFactory.createFromImage
> -----------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: PDFBOX-3181
> URL: https://issues.apache.org/jira/browse/PDFBOX-3181
> Project: PDFBox
> Issue Type: Bug
> Components: PDModel
> Affects Versions: 2.0.0
> Environment: PDFBox 20.RC2 (Oracle JDK 1.6 or Oracle JDK 1.7)
> Reporter: Paolo Clerici
> Assignee: Tilman Hausherr
>
> method
> org.apache.pdfbox.pdmodel.graphics.image.LosslessFactory.createAlphaFromARGBImage
> raise an exception on
> int[] pixels = alphaRaster.getPixels(0, 0,
> alphaRaster.getSampleModel().getWidth(),
> alphaRaster.getSampleModel().getHeight(),
> (int[]) null);
> when alphaRaster.getSampleModel().getWidth() or
> alphaRaster.getSampleModel().getHeight() is greater than image.getWidth() or
> image.getHeight() (e.g. when BufferedImage created by
> java.awt.image.BufferedImage.getSubimage)
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]