[ 
https://issues.apache.org/jira/browse/PDFBOX-1073?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13068841#comment-13068841
 ] 

Mehdi Houshmand commented on PDFBOX-1073:
-----------------------------------------

Yeah, not my proudest bit of work... But I haven't the time to delve into the 
TIFF spec and find out what is wrong with the image in question. The problem is 
thus, we have a TIFF embedded in a PDF and as far as I can tell, the TIFF is 
corrupted or invalid in some way. When PDFBox attempts to decode the TIFF image 
and return a BufferedImage, it throws an error. The TIFF being used is the same 
as the one in a previous bug:
https://issues.apache.org/jira/browse/PDFBOX-834, however, because PDFBox has 
changed how it handles TIFF images, I have to ensure no regressions occur.

The error is thrown in/near CCITTFaxDecodeFilter, this TIFF doesn't have a "K" 
value, so I've set it to default to 0 as in 834, but in 
TIFFFaxDecoder.decodeNextScanline() the error is thrown because bits == 0. I 
don't have a clue what that means. I'm not even convinced if defaulting "K" to 
0 is the right thing to do there.

> Error when handling a TIFF image
> --------------------------------
>
>                 Key: PDFBOX-1073
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-1073
>             Project: PDFBox
>          Issue Type: Bug
>          Components: PDModel
>    Affects Versions: 1.6.0
>         Environment: Ubuntu 11/04
>            Reporter: Mehdi Houshmand
>            Priority: Trivial
>         Attachments: tiffErrorFix.patch
>
>
> There is an error in a TIFF image within a PDF document and when 
> PDCcitt.getRGBImage() is called, there is a disparity between current PDFBox 
> and v0.8.0. The issue is that there now TIFF decoding features whereas the 
> older PDFBox used to hand that off to java.imageio. 
> The bug here isn't in the Ccitt decoder, but rather in how 
> PDCcitt.getRGBImage() handles an error. Rather than bombing out, I have 
> reimplemented the old feature when an error is thrown.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to