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

IIOException "tEXt chunk length is not proper" on opening png file

XMLWordPrintable

    • b23
    • generic
    • generic

        A DESCRIPTION OF THE PROBLEM :
        When I try to read some png files, I get exception:

            at java.desktop/com.sun.imageio.plugins.png.PNGImageReader.readMetadata(PNGImageReader.java:891)
            at java.desktop/com.sun.imageio.plugins.png.PNGImageReader.getImageMetadata(PNGImageReader.java:1799)
            Caused by: javax.imageio.IIOException: tEXt chunk length is not proper
            at java.desktop/com.sun.imageio.plugins.png.PNGImageReader.parse_tEXt_chunk(PNGImageReader.java:575)
            at java.desktop/com.sun.imageio.plugins.png.PNGImageReader.readMetadata(PNGImageReader.java:847)
            .. 28 more
        I think there are errors in file PNGImageReader. For example on line 574:
            if (textLength <= 0) {
                throw new IIOException("tEXt chunk length is not proper");
            }
        Right condition is:
            if (textLength < 0) {
                throw new IIOException("tEXt chunk length is not proper");
            }

        Similar problem is on a few other lines.




        FREQUENCY : always


              jdv Jayathirth D V
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: