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

IIOException while getting second image properties for JPEG

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 7u79, 8u60, 9
    • Fix Version/s: 9
    • Component/s: client-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b127
    • CPU:
      x86
    • OS:
      generic

      Description

      FULL PRODUCT VERSION :


      A DESCRIPTION OF THE PROBLEM :
      Certain JPEGs with embedded thumbnails in APP1 markers throw an exception when attempting to read in the width of second preview image. Example image is here:

      https://github.com/haraldk/TwelveMonkeys/issues/202

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Call getWidth on the image reader for the second image:

      ImageReader reader;
      int pageNum = 1;
      int width = reader.getWidth(pageNum + reader.getMinIndex());

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The thumbnail width is returned
      ACTUAL -
      Caused by: javax.imageio.IIOException: Not a JPEG file: starts with 0xff 0xe9
      at com.sun.imageio.plugins.jpeg.JPEGImageReader.readImageHeader(JPEGImageReader.java)
      at com.sun.imageio.plugins.jpeg.JPEGImageReader.readNativeHeader(JPEGImageReader.java:609)
      at com.sun.imageio.plugins.jpeg.JPEGImageReader.readHeader(JPEGImageReader.java:603)
      at com.sun.imageio.plugins.jpeg.JPEGImageReader.getWidth(JPEGImageReader.java:716)

      REPRODUCIBILITY :
      This bug can be reproduced always.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: