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

Robin Morier commented on IMAGING-247:
--------------------------------------

Thanks for investigating.
As a temporary workaround I'm converting the TIFFs to white_is_zero scheme (so, 
without the palette).
I've spent some time trying to understand the library code that leads to that 
faulty 255 sample value but couldn't quite get my mind around the meaning of 
the bit shifts etc...

> crash on reading tiff image
> ---------------------------
>
>                 Key: IMAGING-247
>                 URL: https://issues.apache.org/jira/browse/IMAGING-247
>             Project: Commons Imaging
>          Issue Type: Bug
>          Components: Format: TIFF
>    Affects Versions: 1.0-alpha1
>            Reporter: Robin Morier
>            Priority: Major
>         Attachments: neutre.TIFF
>
>
> I get an index out of bounds exception trying to load the attached image.
> {noformat}
> java.lang.ArrayIndexOutOfBoundsException: Index 255 out of bounds for length 2
>       at 
> org.apache.commons.imaging.formats.tiff.photometricinterpreters.PhotometricInterpreterPalette.interpretPixel(PhotometricInterpreterPalette.java:53)
>       at 
> org.apache.commons.imaging.formats.tiff.datareaders.DataReaderStrips.interpretStrip(DataReaderStrips.java:179)
>       at 
> org.apache.commons.imaging.formats.tiff.datareaders.DataReaderStrips.readImageData(DataReaderStrips.java:212)
>       at 
> org.apache.commons.imaging.formats.tiff.TiffImageParser.getBufferedImage(TiffImageParser.java:659)
>       at 
> org.apache.commons.imaging.formats.tiff.TiffDirectory.getTiffImage(TiffDirectory.java:163)
>       at 
> org.apache.commons.imaging.formats.tiff.TiffImageParser.getBufferedImage(TiffImageParser.java:469)
>       at 
> org.apache.commons.imaging.Imaging.getBufferedImage(Imaging.java:1442)
>       at 
> org.apache.commons.imaging.Imaging.getBufferedImage(Imaging.java:1404){noformat}
>  
> I'm calling getBufferedImage without any parameters.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to