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

Reading of some GIF images throws java.io.IOException: AddStringToTable: codes: 4096 code_size: 12

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0-alpha1
    • 1.0-alpha2
    • Format: GIF
    • None
    • Oracle JRE 1.7.0_45 on Windows 7
      Oracle JRE 1.7.0_55-b13 on Debian 7.5

    Description

      Hi guys,

      for some GIF images Imaging.getBufferedImage(byte[] bytes) throws the following exception:

      java.io.IOException: AddStringToTable: codes: 4096 code_size: 12
      at org.apache.commons.imaging.common.mylzw.MyLzwDecompressor.addStringToTable(MyLzwDecompressor.java:112)
      at org.apache.commons.imaging.common.mylzw.MyLzwDecompressor.decompress(MyLzwDecompressor.java:168)
      at org.apache.commons.imaging.formats.gif.GifImageParser.readImageDescriptor(GifImageParser.java:388)
      at org.apache.commons.imaging.formats.gif.GifImageParser.readBlocks(GifImageParser.java:251)
      at org.apache.commons.imaging.formats.gif.GifImageParser.readFile(GifImageParser.java:455)
      at org.apache.commons.imaging.formats.gif.GifImageParser.readFile(GifImageParser.java:435)
      at org.apache.commons.imaging.formats.gif.GifImageParser.getBufferedImage(GifImageParser.java:646)
      at org.apache.commons.imaging.Imaging.getBufferedImage(Imaging.java:1378)
      at org.apache.commons.imaging.Imaging.getBufferedImage(Imaging.java:1292)

      I have the same problem when using ImageIO.read(). In my post on Stackoverflow ( http://stackoverflow.com/questions/22259714/arrayindexoutofboundsexception-4096-while-reading-gif-file ) you will find an example image to reproduce the exception and a similar looking JDK bug report that I found using Google. Quote from the bug report:

      A DESCRIPTION OF THE PROBLEM :
      according to specification
      http://www.w3.org/Graphics/GIF/spec-gif89a.txt
      > There is not a requirement to send a clear code when the string table is full.

      However, GIFImageReader requires the clear code when the string table is full.
      GIFImageReader violates the specification, clearly.
      In the real world, sometimes people finds such high compressed gif image.
      so you should fix this bug.

      I hope you will find this information helpful.

      Kind regards
      Dhyan

      Attachments

        1. o23L9.gif
          1.39 MB
          Bruno P. Kinoshita

        Issue Links

          Activity

            People

              kinow Bruno P. Kinoshita
              Dhyan Dhyan Blum
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 20m
                  1h 20m