You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Andrew Duffy (JIRA)" <ji...@apache.org> on 2009/09/08 17:21:57 UTC
[jira] Created: (PDFBOX-519) NullPointerException in
SetNonStrokingSeparation.java
NullPointerException in SetNonStrokingSeparation.java
-----------------------------------------------------
Key: PDFBOX-519
URL: https://issues.apache.org/jira/browse/PDFBOX-519
Project: PDFBox
Issue Type: Bug
Components: Parsing
Affects Versions: 0.8.0-incubator
Reporter: Andrew Duffy
Priority: Minor
Attachments: npe.patch
Caused by a failure to check for a null return from PDSeparation.getColorValues()
java.lang.NullPointerException
at org.apache.pdfbox.util.operator.SetNonStrokingSeparation.process(SetNonStrokingSeparation.java:56)
at org.apache.pdfbox.util.operator.SetStrokingColor.process(SetStrokingColor.java:78)
at org.apache.pdfbox.util.PDFStreamEngine.processOperator(PDFStreamEngine.java:510)
at org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:223)
at org.apache.pdfbox.util.PDFStreamEngine.processStream(PDFStreamEngine.java:182)
at org.apache.pdfbox.pdfviewer.PageDrawer.drawPage(PageDrawer.java:92)
at org.apache.pdfbox.pdmodel.PDPage.convertToImage(PDPage.java:686)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Issue Comment Edited: (PDFBOX-519) NullPointerException in
SetNonStrokingSeparation.java
Posted by "Andrew Duffy (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PDFBOX-519?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12752660#action_12752660 ]
Andrew Duffy edited comment on PDFBOX-519 at 9/8/09 11:38 AM:
--------------------------------------------------------------
I did more investigation. For a display a separation works by passing a tint value between 0 and 1 to a transformation function to get components of an alternate colour space.
PDSeparation.getColorValues assumes that the tint function is a type 2 function always returns the value for a tint of 1.0 (it returns the value of C1 from the tint transformation function).
I've attached a patch to PDSeparation.java that throws an exception if the function is not type 2 rather than retuning null.
In theory, it should be possible to interpolate for the tint value for a type 2 function; type 0 seems relatively easy as well.
was (Author: andrew_duffy):
I did more investigation. For a display a separation works by passing a tint value between 0 and 1 to a transformation function to get components of an alternate colour space.
PDSeparation.getColorValues assumes that the tint function is a type 2 function always returns the value for a tint of 1.0 (it returns the value of C1 from the tint transformation function).
I've attached a new patch (to PDSeparation.java; the old patch is incorrect) that throws an exception if the function is not type 2.
> NullPointerException in SetNonStrokingSeparation.java
> -----------------------------------------------------
>
> Key: PDFBOX-519
> URL: https://issues.apache.org/jira/browse/PDFBOX-519
> Project: PDFBox
> Issue Type: Bug
> Components: Parsing
> Affects Versions: 0.8.0-incubator
> Reporter: Andrew Duffy
> Priority: Minor
> Attachments: npe.patch
>
>
> Caused by a failure to check for a null return from PDSeparation.getColorValues()
> java.lang.NullPointerException
> at org.apache.pdfbox.util.operator.SetNonStrokingSeparation.process(SetNonStrokingSeparation.java:56)
> at org.apache.pdfbox.util.operator.SetStrokingColor.process(SetStrokingColor.java:78)
> at org.apache.pdfbox.util.PDFStreamEngine.processOperator(PDFStreamEngine.java:510)
> at org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:223)
> at org.apache.pdfbox.util.PDFStreamEngine.processStream(PDFStreamEngine.java:182)
> at org.apache.pdfbox.pdfviewer.PageDrawer.drawPage(PageDrawer.java:92)
> at org.apache.pdfbox.pdmodel.PDPage.convertToImage(PDPage.java:686)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (PDFBOX-519) NullPointerException in
SetNonStrokingSeparation.java
Posted by "Andrew Duffy (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PDFBOX-519?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Andrew Duffy updated PDFBOX-519:
--------------------------------
Comment: was deleted
(was: Patch checks for null.)
> NullPointerException in SetNonStrokingSeparation.java
> -----------------------------------------------------
>
> Key: PDFBOX-519
> URL: https://issues.apache.org/jira/browse/PDFBOX-519
> Project: PDFBox
> Issue Type: Bug
> Components: Parsing
> Affects Versions: 0.8.0-incubator
> Reporter: Andrew Duffy
> Priority: Minor
> Attachments: npe.patch
>
>
> Caused by a failure to check for a null return from PDSeparation.getColorValues()
> java.lang.NullPointerException
> at org.apache.pdfbox.util.operator.SetNonStrokingSeparation.process(SetNonStrokingSeparation.java:56)
> at org.apache.pdfbox.util.operator.SetStrokingColor.process(SetStrokingColor.java:78)
> at org.apache.pdfbox.util.PDFStreamEngine.processOperator(PDFStreamEngine.java:510)
> at org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:223)
> at org.apache.pdfbox.util.PDFStreamEngine.processStream(PDFStreamEngine.java:182)
> at org.apache.pdfbox.pdfviewer.PageDrawer.drawPage(PageDrawer.java:92)
> at org.apache.pdfbox.pdmodel.PDPage.convertToImage(PDPage.java:686)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (PDFBOX-519) NullPointerException in
SetNonStrokingSeparation.java
Posted by "Andrew Duffy (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PDFBOX-519?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Andrew Duffy updated PDFBOX-519:
--------------------------------
Attachment: (was: npe.patch)
> NullPointerException in SetNonStrokingSeparation.java
> -----------------------------------------------------
>
> Key: PDFBOX-519
> URL: https://issues.apache.org/jira/browse/PDFBOX-519
> Project: PDFBox
> Issue Type: Bug
> Components: Parsing
> Affects Versions: 0.8.0-incubator
> Reporter: Andrew Duffy
> Priority: Minor
> Attachments: npe.patch
>
>
> Caused by a failure to check for a null return from PDSeparation.getColorValues()
> java.lang.NullPointerException
> at org.apache.pdfbox.util.operator.SetNonStrokingSeparation.process(SetNonStrokingSeparation.java:56)
> at org.apache.pdfbox.util.operator.SetStrokingColor.process(SetStrokingColor.java:78)
> at org.apache.pdfbox.util.PDFStreamEngine.processOperator(PDFStreamEngine.java:510)
> at org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:223)
> at org.apache.pdfbox.util.PDFStreamEngine.processStream(PDFStreamEngine.java:182)
> at org.apache.pdfbox.pdfviewer.PageDrawer.drawPage(PageDrawer.java:92)
> at org.apache.pdfbox.pdmodel.PDPage.convertToImage(PDPage.java:686)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (PDFBOX-519) NullPointerException in
SetNonStrokingSeparation.java
Posted by "Andrew Duffy (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PDFBOX-519?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Andrew Duffy updated PDFBOX-519:
--------------------------------
Attachment: npe.patch
Patch checks for null.
> NullPointerException in SetNonStrokingSeparation.java
> -----------------------------------------------------
>
> Key: PDFBOX-519
> URL: https://issues.apache.org/jira/browse/PDFBOX-519
> Project: PDFBox
> Issue Type: Bug
> Components: Parsing
> Affects Versions: 0.8.0-incubator
> Reporter: Andrew Duffy
> Priority: Minor
> Attachments: npe.patch
>
>
> Caused by a failure to check for a null return from PDSeparation.getColorValues()
> java.lang.NullPointerException
> at org.apache.pdfbox.util.operator.SetNonStrokingSeparation.process(SetNonStrokingSeparation.java:56)
> at org.apache.pdfbox.util.operator.SetStrokingColor.process(SetStrokingColor.java:78)
> at org.apache.pdfbox.util.PDFStreamEngine.processOperator(PDFStreamEngine.java:510)
> at org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:223)
> at org.apache.pdfbox.util.PDFStreamEngine.processStream(PDFStreamEngine.java:182)
> at org.apache.pdfbox.pdfviewer.PageDrawer.drawPage(PageDrawer.java:92)
> at org.apache.pdfbox.pdmodel.PDPage.convertToImage(PDPage.java:686)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (PDFBOX-519) NullPointerException in
SetNonStrokingSeparation.java
Posted by "Andrew Duffy (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PDFBOX-519?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Andrew Duffy updated PDFBOX-519:
--------------------------------
Attachment: npe.patch
I did more investigation. For a display a separation works by passing a tint value between 0 and 1 to a transformation function to get components of an alternate colour space.
PDSeparation.getColorValues assumes that the tint function is a type 2 function always returns the value for a tint of 1.0 (it returns the value of C1 from the tint transformation function).
I've attached a new patch (to PDSeparation.java; the old patch is incorrect) that throws an exception if the function is not type 2.
> NullPointerException in SetNonStrokingSeparation.java
> -----------------------------------------------------
>
> Key: PDFBOX-519
> URL: https://issues.apache.org/jira/browse/PDFBOX-519
> Project: PDFBox
> Issue Type: Bug
> Components: Parsing
> Affects Versions: 0.8.0-incubator
> Reporter: Andrew Duffy
> Priority: Minor
> Attachments: npe.patch
>
>
> Caused by a failure to check for a null return from PDSeparation.getColorValues()
> java.lang.NullPointerException
> at org.apache.pdfbox.util.operator.SetNonStrokingSeparation.process(SetNonStrokingSeparation.java:56)
> at org.apache.pdfbox.util.operator.SetStrokingColor.process(SetStrokingColor.java:78)
> at org.apache.pdfbox.util.PDFStreamEngine.processOperator(PDFStreamEngine.java:510)
> at org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:223)
> at org.apache.pdfbox.util.PDFStreamEngine.processStream(PDFStreamEngine.java:182)
> at org.apache.pdfbox.pdfviewer.PageDrawer.drawPage(PageDrawer.java:92)
> at org.apache.pdfbox.pdmodel.PDPage.convertToImage(PDPage.java:686)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (PDFBOX-519) NullPointerException in
SetNonStrokingSeparation.java
Posted by "Daniel Wilson (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PDFBOX-519?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12753817#action_12753817 ]
Daniel Wilson commented on PDFBOX-519:
--------------------------------------
Andrew,
This one looks fine too ... and doesn't break an tests ... but can I see a PDF that is helped by this?
And ... if you are familiar enough with the type 0 & type 2 functions, I'd be glad for any suggestions on implementing the tint stuff. That is something I worked on a few months ago, but only got partway.
Thanks!
Daniel
> NullPointerException in SetNonStrokingSeparation.java
> -----------------------------------------------------
>
> Key: PDFBOX-519
> URL: https://issues.apache.org/jira/browse/PDFBOX-519
> Project: PDFBox
> Issue Type: Bug
> Components: Parsing
> Affects Versions: 0.8.0-incubator
> Reporter: Andrew Duffy
> Priority: Minor
> Attachments: npe.patch
>
>
> Caused by a failure to check for a null return from PDSeparation.getColorValues()
> java.lang.NullPointerException
> at org.apache.pdfbox.util.operator.SetNonStrokingSeparation.process(SetNonStrokingSeparation.java:56)
> at org.apache.pdfbox.util.operator.SetStrokingColor.process(SetStrokingColor.java:78)
> at org.apache.pdfbox.util.PDFStreamEngine.processOperator(PDFStreamEngine.java:510)
> at org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:223)
> at org.apache.pdfbox.util.PDFStreamEngine.processStream(PDFStreamEngine.java:182)
> at org.apache.pdfbox.pdfviewer.PageDrawer.drawPage(PageDrawer.java:92)
> at org.apache.pdfbox.pdmodel.PDPage.convertToImage(PDPage.java:686)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (PDFBOX-519) NullPointerException in
SetNonStrokingSeparation.java
Posted by "Andrew Duffy (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PDFBOX-519?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Andrew Duffy updated PDFBOX-519:
--------------------------------
Attachment: Democratic Renewal final.pdf
There's one behind the "To download a copy of The Report of the Democracy Commission click here...." link on this site: http://www.democracycommission.ie/showPage.php
I've attached it, but I don't think I can grant a licence for inclusion. Anyway, without the patch, three NullPointerExceptions are output to strderr when rendering; with it, three IOExceptions explaining the problem are output. Not much of an improvement, but at least it points out where the functionality is missing.
I'll try to schedule a day to implement type 0 (sampled) and type 2 (interpolated) functions, and I'll submit along with a patch to implement the DeviceN colorspace which is very similar to a separation.
> NullPointerException in SetNonStrokingSeparation.java
> -----------------------------------------------------
>
> Key: PDFBOX-519
> URL: https://issues.apache.org/jira/browse/PDFBOX-519
> Project: PDFBox
> Issue Type: Bug
> Components: Parsing
> Affects Versions: 0.8.0-incubator
> Reporter: Andrew Duffy
> Priority: Minor
> Attachments: Democratic Renewal final.pdf, npe.patch
>
>
> Caused by a failure to check for a null return from PDSeparation.getColorValues()
> java.lang.NullPointerException
> at org.apache.pdfbox.util.operator.SetNonStrokingSeparation.process(SetNonStrokingSeparation.java:56)
> at org.apache.pdfbox.util.operator.SetStrokingColor.process(SetStrokingColor.java:78)
> at org.apache.pdfbox.util.PDFStreamEngine.processOperator(PDFStreamEngine.java:510)
> at org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:223)
> at org.apache.pdfbox.util.PDFStreamEngine.processStream(PDFStreamEngine.java:182)
> at org.apache.pdfbox.pdfviewer.PageDrawer.drawPage(PageDrawer.java:92)
> at org.apache.pdfbox.pdmodel.PDPage.convertToImage(PDPage.java:686)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.