[
https://issues.apache.org/jira/browse/PDFBOX-1307?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13651173#comment-13651173
]
Andreas Lehmkühler commented on PDFBOX-1307:
--------------------------------------------
Rendering works fine since 1.7.0 but starting with that version I get an
exception when extracting the images
Exception in thread "main" java.io.IOException: Unsupported color conversion
request
at org.apache.pdfbox.util.ImageIOUtil.writeImage(ImageIOUtil.java:125)
at org.apache.pdfbox.util.ImageIOUtil.writeImage(ImageIOUtil.java:87)
at
org.apache.pdfbox.pdmodel.graphics.xobject.PDJpeg.write2OutputStream(PDJpeg.java:295)
at
org.apache.pdfbox.pdmodel.graphics.xobject.PDXObjectImage.write2file(PDXObjectImage.java:140)
at
org.apache.pdfbox.ExtractImages.processResources(ExtractImages.java:202)
at org.apache.pdfbox.ExtractImages.extractImages(ExtractImages.java:160)
at org.apache.pdfbox.ExtractImages.main(ExtractImages.java:65)
> extracted images from a PDF sometimes come out inverted
> -------------------------------------------------------
>
> Key: PDFBOX-1307
> URL: https://issues.apache.org/jira/browse/PDFBOX-1307
> Project: PDFBox
> Issue Type: Bug
> Affects Versions: 1.6.0
> Reporter: Ian Holsman
> Priority: Minor
> Attachments: IIIm1.jpg, IIIm2.jpg, invertedImage.pdf
>
>
> Hi.
> I am extracting images from a PDF (using the code below).
> sometimes the images appear inverted
> PDResources r = page.getResources();
> Map<String, PDXObjectImage> images = r.getImages();
> for (Map.Entry<String, PDXObjectImage> e : images.entrySet()) {
>
> BufferedImage bi = null;
> try {
> bi = ((PDXObjectImage) e.getValue()).getRGBImage();
> } catch (Exception ee) {
> logger.info("can't read image ;-(", ee);
> }
> if (bi != null) {
> currentPage.addImage(bi);
> ((PDXObjectImage)
> e.getValue()).write2file("/tmp/II"+e.getKey());
> }
> }
>
> and i'm not sure, but there may be a memory leak grabbing the images this way
> as well.. but that could in my code.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira