Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-7148271

REGRESSION with PNG Image loading

XMLWordPrintable

      The follow simple sample work with Java 6 and throw the follow Exception with Java 7.
       

      import java.io.FileInputStream;

      import java.io.FileNotFoundException;

      import java.io.IOException;

       

      import javax.imageio.ImageIO;

       

      public class TestImageIO {

       

          public static void main( String[] args ) throws FileNotFoundException, IOException {

              ImageIO.read( new FileInputStream( "CorruptImage.png" ) );

          }

      }

       

       

      Exception in thread "main" javax.imageio.IIOException: Error reading PNG image data

            at com.sun.imageio.plugins.png.PNGImageReader.readImage(PNGImageReader.java:1308)

            at com.sun.imageio.plugins.png.PNGImageReader.read(PNGImageReader.java:1577)

            at javax.imageio.ImageIO.read(ImageIO.java:1448)

            at javax.imageio.ImageIO.read(ImageIO.java:1352)

            at TestImageIO.main(TestImageIO.java:10)

      Caused by: java.util.zip.ZipException: invalid distance too far back

            at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:164)

            at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)

            at java.io.BufferedInputStream.read(BufferedInputStream.java:254)

            at java.io.FilterInputStream.read(FilterInputStream.java:83)

            at com.sun.imageio.plugins.png.PNGImageReader.decodePass(PNGImageReader.java:1085)

            at com.sun.imageio.plugins.png.PNGImageReader.decodeImage(PNGImageReader.java:1196)

            at com.sun.imageio.plugins.png.PNGImageReader.readImage(PNGImageReader.java:1301)

            ... 4 more

            sherman Xueming Shen
            tyao Ting-Yun Ingrid Yao (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: