You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Andreas Lehmkühler (JIRA)" <ji...@apache.org> on 2012/05/18 16:55:09 UTC

[jira] [Resolved] (PDFBOX-892) ClassCastException in PDXObjectImage.getMask

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

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

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

In revision 1340117 I changed the return value typ of PDXObjectImage#getMask from COSArray to COSBase as the mask may be an array or a stream.
                
> ClassCastException in PDXObjectImage.getMask
> --------------------------------------------
>
>                 Key: PDFBOX-892
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-892
>             Project: PDFBox
>          Issue Type: Bug
>          Components: PDModel
>    Affects Versions: 1.3.1
>            Reporter: Marko Mocnik
>            Assignee: Andreas Lehmkühler
>             Fix For: 1.7.0
>
>         Attachments: ImagePdfBoxTest2.java, culprit.pdf
>
>
> Certain /FlateDecode encoded images which contain a Mask Dictionary cause the getRGBImage() method to fail with the following exception:
> java.lang.ClassCastException: org.apache.pdfbox.cos.COSStream cannot be cast to org.apache.pdfbox.cos.COSArray
> 	at org.apache.pdfbox.pdmodel.graphics.xobject.PDXObjectImage.getMask(PDXObjectImage.java:364)
> 	at org.apache.pdfbox.pdmodel.graphics.xobject.PDPixelMap.getRGBImage(PDPixelMap.java:205)
> 	at org.apache.pdfbox.pdmodel.graphics.xobject.PDPixelMap.write2OutputStream(PDPixelMap.java:310)
> 	at org.apache.pdfbox.pdmodel.graphics.xobject.PDXObjectImage.write2file(PDXObjectImage.java:139)
> 	at ImagePdfBoxTest2.main(ImagePdfBoxTest2.java:41)
> I will attach a simple test program and a test dokument which was created with OpenOffice 3.2.

--
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