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

IllegalArgumentException: "Invalid ICC Profile Data" when reading certain JPEGs

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 1.4.2_18, 5.0
    • Fix Version/s: 6
    • Component/s: client-libs
    • Subcomponent:
    • Resolved In Build:
      b81
    • CPU:
      x86
    • OS:
      linux, windows_2003

      Backports

        Description

        FULL PRODUCT VERSION :
        Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
        Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode, sharing)


        ADDITIONAL OS VERSION INFORMATION :
        (Re-)produced on 2 Debian systems:
        Linux metis 2.6.8-2-686-smp #1 SMP Thu May 19 17:27:55 JST 2005 i686 GNU/Linux
        Linux phoebe.liland.org 2.6.8-2-686-smp #1 SMP Tue Aug 16 12:08:30 UTC 2005 i686 GNU/Linux

        .. and one Gentoo system:
        Linux halley 2.6.15-gentoo-r1 #1 SMP PREEMPT Wed Jan 25 13:59:38 CET 2006 i686 Intel(R) Pentium(R) M processor 2.00GHz GenuineIntel GNU/Linux


        EXTRA RELEVANT SYSTEM CONFIGURATION :
        Sample image file is provided here:
        http://member.ycn.com/~emu/keiler16.jpg

        I would like to attach this file to the bug report. However since this does not seem to be possible, I will keep it available at the given URL as long as possible.

        A DESCRIPTION OF THE PROBLEM :
        javax.imageio.ImageIO.read(ImageInputStream stream) throws
        an IllegalArgumentException for certain JPEG images. The error message complains about an "Invalid ICC Profile". Other programs (editors/viewser) report no problems when reading these images.

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        1. download image from
        http://member.ycn.com/~emu/keiler16.jpg
        2. open with ImageIO.read(..) method

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        A BufferedImage object should be created from the given image data.
        ACTUAL -
        IllegalArgumentException is thrown.

        ERROR MESSAGES/STACK TRACES THAT OCCUR :
        java.lang.IllegalArgumentException: Invalid ICC Profile Data
                at java.awt.color.ICC_Profile.getInstance(ICC_Profile.java:753)
                at com.sun.imageio.plugins.jpeg.JPEGImageReader.setImageData(JPEGImageReader.java:596)
                at com.sun.imageio.plugins.jpeg.JPEGImageReader.readImageHeader(Native Method)
                at com.sun.imageio.plugins.jpeg.JPEGImageReader.readNativeHeader(JPEGImageReader.java:554)
                at com.sun.imageio.plugins.jpeg.JPEGImageReader.checkTablesOnly(JPEGImageReader.java:309)
                at com.sun.imageio.plugins.jpeg.JPEGImageReader.gotoImage(JPEGImageReader.java:431)
                at com.sun.imageio.plugins.jpeg.JPEGImageReader.readHeader(JPEGImageReader.java:547)
                at com.sun.imageio.plugins.jpeg.JPEGImageReader.readInternal(JPEGImageReader.java:880)
                at com.sun.imageio.plugins.jpeg.JPEGImageReader.read(JPEGImageReader.java:864)
                at javax.imageio.ImageIO.read(ImageIO.java:1400)
                at javax.imageio.ImageIO.read(ImageIO.java:1322)
        ...
         

        REPRODUCIBILITY :
        This bug can be reproduced always.

        ---------- BEGIN SOURCE ----------
        import javax.imageio.ImageIO;
        import java.io.*;

        public class ImageTest {
          public static void main(String[] args) throws IOException {
            ImageIO.read(new File("keiler16.jpg"));
          }
        }

        ---------- END SOURCE ----------

        CUSTOMER SUBMITTED WORKAROUND :
        removing metadata from JPEG with a tool like jpegoptim (linux) or purejpeg (windows)

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  bae Andrew Brygin
                  Reporter:
                  prr Philip Race
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  0 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Imported:
                    Indexed: