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/04/07 00:03:15 UTC
[jira] [Commented] (PDFBOX-1147) Printing a PDF with an image
inside show black.
[ https://issues.apache.org/jira/browse/PDFBOX-1147?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13961542#comment-13961542 ]
Tilman Hausherr commented on PDFBOX-1147:
-----------------------------------------
I sometimes got this exception with my modified version (that uses more test files), and it is always for one of the files with LZW encoding:
Tests run: 80, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 30.082 sec <<< FAILURE! - in org.apache.pdfbox.util.TestRendering
render[PDFBOX-205-hexnumberproblem.pdf](org.apache.pdfbox.util.TestRendering) Time elapsed: 0.046 sec <<< ERROR!
java.lang.NullPointerException: null
at org.apache.pdfbox.filter.LZWFilter.decode(LZWFilter.java:84)
at org.apache.pdfbox.filter.Filter.decode(Filter.java:58)
(...)
at org.apache.pdfbox.util.TestRendering.render(TestRendering.java:78)
After looking at TestRendering I realized that it is a race condition / parallel problem because that test uses several threads. We're using only one instance of each filter type, so it was wrong to use a class variable. I've modified this in rev 1585353 for the trunk and rev 1585354 for the 1.8 branch.
> Printing a PDF with an image inside show black.
> -----------------------------------------------
>
> Key: PDFBOX-1147
> URL: https://issues.apache.org/jira/browse/PDFBOX-1147
> Project: PDFBox
> Issue Type: Bug
> Components: Rendering
> Affects Versions: 1.6.0
> Environment: Windows XP SP3 32 bit
> Java 1.6.0_27
> Reporter: Rafa Hernandez
> Assignee: Tilman Hausherr
> Labels: LZW, image, print
> Fix For: 1.8.5, 2.0.0
>
> Attachments: p1logo.pdf, pdfbox-1147.pdf-1.png, stream.decoded, stream.lzw, stream2.lzw
>
>
> I have a PDF with a image inside.
> When i print the PDF the image show corrupted similar a black area.
> In the java console:
> 25-oct-2011 13:12:39 org.apache.pdfbox.pdmodel.graphics.xobject.PDPixelMap getRGBImage
> GRAVE: java.io.StreamCorruptedException: Error: data is null
> java.io.StreamCorruptedException: Error: data is null
> at org.apache.pdfbox.filter.LZWFilter.decode(LZWFilter.java:82)
> at org.apache.pdfbox.cos.COSStream.doDecode(COSStream.java:301)
> at org.apache.pdfbox.cos.COSStream.doDecode(COSStream.java:229)
--
This message was sent by Atlassian JIRA
(v6.2#6252)