[
https://issues.apache.org/jira/browse/PDFBOX-2288?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14111178#comment-14111178
]
Tilman Hausherr commented on PDFBOX-2288:
-----------------------------------------
I doubt that you'll be happy getting bmp image files that are bigger than png
files. Using .bmp images is, well, unusual. For the best method to save images,
look at the ExtractImages.java source code.
> Defective BufferedImage for flate encoded images
> ------------------------------------------------
>
> Key: PDFBOX-2288
> URL: https://issues.apache.org/jira/browse/PDFBOX-2288
> Project: PDFBox
> Issue Type: Bug
> Components: PDModel
> Affects Versions: 2.0.0
> Reporter: Dominic Tubach
> Attachments: test.pdf
>
>
> The BufferedImages for flate encoded images seem to be defective. The
> following code results in a ArrayIndexOutOfBoundsException when writing the
> image:
> {code}
> PDDocument doc = PDDocument.load("test.pdf");
> Iterator<PDXObject> it =
> doc.getPage(0).getResources().getXObjects().values().iterator();
> PDImageXObject image = (PDImageXObject) it.next();
> BufferedImage bi = image.getImage();
> try (FileOutputStream fos = new FileOutputStream("test.bmp")) {
> ImageIO.write(bi, "bmp", fos);
> }
> {code}
> The problem did not exist in 1.8. The attached PDF just contains one flate
> encoded image.
--
This message was sent by Atlassian JIRA
(v6.2#6252)