线程“main”中的异常javax.imageio.IIOException:无效的icc配置文件:错误的序列号

时间:2012-02-16 10:34:38

标签: java javax.imageio

我试图读取JPG以便调整它的大小,但有时候,当我尝试这样做时:

ImageIO.read(new FileInputStream("R:/temp/test.jpg"));

我收到以下例外:

Exception in thread "main" javax.imageio.IIOException: Invalid icc profile: bad sequence number
at com.sun.imageio.plugins.jpeg.JPEGImageReader.readImageHeader(Native Method)
at com.sun.imageio.plugins.jpeg.JPEGImageReader.readNativeHeader(JPEGImageReader.java:560)
at com.sun.imageio.plugins.jpeg.JPEGImageReader.checkTablesOnly(JPEGImageReader.java:315)
at com.sun.imageio.plugins.jpeg.JPEGImageReader.gotoImage(JPEGImageReader.java:437)
at com.sun.imageio.plugins.jpeg.JPEGImageReader.readHeader(JPEGImageReader.java:553)
at com.sun.imageio.plugins.jpeg.JPEGImageReader.readInternal(JPEGImageReader.java:931)
at com.sun.imageio.plugins.jpeg.JPEGImageReader.read(JPEGImageReader.java:915)
at javax.imageio.ImageIO.read(ImageIO.java:1422)
at javax.imageio.ImageIO.read(ImageIO.java:1326)

我不确切地知道为什么有时它会起作用,有时它会失败。它可能来自JPG本身,但我如何解决这个问题?

由于

0 个答案:

没有答案