Uploaded image for project: 'Commons Imaging'
  1. Commons Imaging
  2. IMAGING-143

Decompression Exception of Tiff Group 3 with T4 Options = 4

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.0-alpha1
    • Fix Version/s: Patch Needed
    • Component/s: Format: TIFF
    • Labels:
      None

      Description

      I have multiple tiff images that are causing an "ImageReadException: Decompression error". All are Group 3 (T.4) encoded with T4Options tag value 4 (zero fill to byte). Other Group 3 images without T4Options 4 work fine.

      Stepping through Imaging 1.0 RC7, the hasFill boolean is being set properly to true. The exception is thrown at the bottom of method HuffmanTree.java decode(bitStream). Nothing is passed to this method indicating zero fill or not. I will attach a test image that reproduces the issue. The stack trace:

      Caused by: org.apache.commons.imaging.ImageReadException: Decompression error
             at org.apache.commons.imaging.common.itu_t4.T4AndT6Compression.decompressT4_1D(T4AndT6Compression.java:254)
             at org.apache.commons.imaging.formats.tiff.datareaders.DataReader.decompress(DataReader.java:163)
             at org.apache.commons.imaging.formats.tiff.datareaders.DataReaderStrips.readImageData(DataReaderStrips.java:216)
             at org.apache.commons.imaging.formats.tiff.TiffImageParser.getBufferedImage(TiffImageParser.java:676)
             at org.apache.commons.imaging.formats.tiff.TiffDirectory.getTiffImage(TiffDirectory.java:161)
             at org.apache.commons.imaging.formats.tiff.TiffImageParser.getBufferedImage(TiffImageParser.java:478)
             at org.apache.commons.imaging.Imaging.getBufferedImage(Imaging.java:1379)
             at org.apache.commons.imaging.Imaging.getBufferedImage(Imaging.java:1293)
             at com.dstresearch.baseutils.ApacheImagingUtil.readImage(ApacheImagingUtil.java:157)
             ... 27 more
      Caused by: org.apache.commons.imaging.common.itu_t4.HuffmanTreeException: Invalid bit pattern
             at org.apache.commons.imaging.common.itu_t4.HuffmanTree.decode(HuffmanTree.java:89)
             at org.apache.commons.imaging.common.itu_t4.T4AndT6Compression.decompressT4_1D(T4AndT6Compression.java:240)
             ... 35 more
      

        Attachments

        1. group3test.tif
          6 kB
          Josh Highley

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              joshhighley Josh Highley
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: