You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Tilman Hausherr (JIRA)" <ji...@apache.org> on 2014/11/04 18:38:35 UTC

[jira] [Reopened] (PDFBOX-2479) NPE in PDICCBased.getColorSpaceType

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

Tilman Hausherr reopened PDFBOX-2479:
-------------------------------------

I disagree with this change:
The method is used only by preflight and preflight needs to know if an ICC profile can't be read. I don't have the PDF/A spec but if the alternate colorspace is used, this means that the PDF won't look exactly like intended and that is the point of PDF/A. I tried the PDFA checker of pdftools this morning and they mention that the ICC profile is broken. What I had in mind (and already tested but I then went to work) was to throw an exception, and to catch the exception in preflight and then add it to the error table.

> NPE in PDICCBased.getColorSpaceType
> -----------------------------------
>
>                 Key: PDFBOX-2479
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-2479
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Preflight
>    Affects Versions: 2.0.0
>            Reporter: Tilman Hausherr
>             Fix For: 2.0.0
>
>         Attachments: 001683.pdf, 001960.pdf
>
>
> I get this exception with the attached file:
> {code}
> java.lang.NullPointerException
> 	at org.apache.pdfbox.pdmodel.graphics.color.PDICCBased.getColorSpaceType(PDICCBased.java:296)
> 	at org.apache.pdfbox.preflight.content.PreflightStreamEngine.isDeviceIndependent(PreflightStreamEngine.java:452)	at org.apache.pdfbox.preflight.content.PreflightStreamEngine.isDeviceIndependent(PreflightStreamEngine.java:452)
> 	at org.apache.pdfbox.preflight.content.PreflightStreamEngine.validColorSpace(PreflightStreamEngine.java:401)
> 	at org.apache.pdfbox.preflight.content.PreflightStreamEngine.checkColorOperators(PreflightStreamEngine.java:384)
> 	at org.apache.pdfbox.preflight.content.PreflightContentStream.processOperator(PreflightContentStream.java:154)
> 	at org.apache.pdfbox.contentstream.PDFStreamEngine.processStreamOperators(PDFStreamEngine.java:457)
> 	at org.apache.pdfbox.contentstream.PDFStreamEngine.processStream(PDFStreamEngine.java:421)
> 	at org.apache.pdfbox.contentstream.PDFStreamEngine.processStream(PDFStreamEngine.java:394)
> 	at org.apache.pdfbox.contentstream.PDFStreamEngine.processPage(PDFStreamEngine.java:164)
> 	at org.apache.pdfbox.preflight.content.PreflightContentStream.validPageContentStream(PreflightContentStream.java:72)
> 	at org.apache.pdfbox.preflight.process.reflect.SinglePageValidationProcess.validateContent(SinglePageValidationProcess.java:182)
> 	at org.apache.pdfbox.preflight.process.reflect.SinglePageValidationProcess.validate(SinglePageValidationProcess.java:87)
> 	at org.apache.pdfbox.preflight.utils.ContextHelper.callValidation(ContextHelper.java:73)
> 	at org.apache.pdfbox.preflight.utils.ContextHelper.validateElement(ContextHelper.java:52)
> 	at org.apache.pdfbox.preflight.process.PageTreeValidationProcess.validatePage(PageTreeValidationProcess.java:56)
> 	at org.apache.pdfbox.preflight.process.PageTreeValidationProcess.validate(PageTreeValidationProcess.java:45)
> 	at org.apache.pdfbox.preflight.utils.ContextHelper.callValidation(ContextHelper.java:73)
> 	at org.apache.pdfbox.preflight.utils.ContextHelper.validateElement(ContextHelper.java:88)
> 	at org.apache.pdfbox.preflight.PreflightDocument.validate(PreflightDocument.java:168)
> 	at pdfboxpageimageextraction.PreflightTest.main(PreflightTest.java:46)
> {code}
> The logfile also has this:
> {code}
> ERROR [main] org.apache.pdfbox.pdmodel.graphics.color.PDICCBased:133 - Can't read embedded ICC profile, using alternate color space: DeviceRGB
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)