[ 
https://issues.apache.org/jira/browse/PDFBOX-1145?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Andreas Lehmkühler resolved PDFBOX-1145.
----------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.7.0
         Assignee: Andreas Lehmkühler

Images most likely don't need any further resources than their own, so that 
they can be extracted without parsing the content stream of the page itself. 
But image masks like those in the given example use the current non stroking 
color as stencil color. That value isn't present without parsing the content 
stream of the page.

I fixed the NPE by using Color.BLACK as missing stencil color. This is only a 
workaround, but I guess the best we can do in such cases.
                
> "write2file" gives Null Pointer Exception
> -----------------------------------------
>
>                 Key: PDFBOX-1145
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-1145
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Writing
>    Affects Versions: 1.6.0
>         Environment: Windows XP version 2002, service pack 3, Inte;(R) 
> Pentium(R) 4 CPU, 3.00GHz, 2.99 GHz, 1.99 GB of RAM, 
>            Reporter: sagar pise
>            Assignee: Andreas Lehmkühler
>              Labels: image, nullpointerexception, writing
>             Fix For: 1.7.0
>
>         Attachments: TestFile.pdf
>
>
> Oct 24, 2011 11:00:15 AM 
> org.apache.pdfbox.pdmodel.graphics.xobject.PDPixelMap getRGBImage
> SEVERE: java.lang.NullPointerException
> java.lang.NullPointerException
>       at 
> org.apache.pdfbox.pdmodel.graphics.xobject.PDXObjectImage.getColorSpace(PDXObjectImage.java:286)
>       at 
> org.apache.pdfbox.pdmodel.graphics.xobject.PDPixelMap.getRGBImage(PDPixelMap.java:140)
>       at 
> org.apache.pdfbox.pdmodel.graphics.xobject.PDPixelMap.write2OutputStream(PDPixelMap.java:285)
>       at 
> org.apache.pdfbox.pdmodel.graphics.xobject.PDXObjectImage.write2file(PDXObjectImage.java:139)
>       at org.apache.pdfbox.ExtractImages.extractImages(ExtractImages.java:165)
>       at org.apache.pdfbox.ExtractImages.main(ExtractImages.java:62)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


Reply via email to