Invalid icc profile: duplicate sequence numbers
2017-07-01 16:03
351 查看
处理图片时报异常信息:
javax.imageio.IIOException: Invalid icc profile: duplicate sequence numbers
报异常的图片:
网上有人遇到了同样的异常信息,并使用插件解决了问题: http://stackoverflow.com/questions/32023809/javax-imageio-iioexception-invalid-icc-profile-duplicate-sequence-numbers TwelveMonkeys ImageIO官网地址 http://haraldk.github.io/TwelveMonkeys/#jpeg TwelveMonkeys ImageIO is a collection of plugins and extensions for Java's ImageIO.
These plugins extends the number of image file formats supported in Java, using the javax.imageio.* package. The main purpose of this project is to provide support for formats not covered by the JRE itself.
TwelveMonkeys ImageIO工程主要支持了一些JRE自己没有覆盖到的图片格式。
问题解决方案
1.将相应的格式包导入到工程中,如jpeg
<dependency>
<groupId>com.twelvemonkeys.imageio</groupId>
<artifactId>imageio-jpeg</artifactId>
<version>3.0-rc5</version>
</dependency>
注意版本问题
最新版的插件需要使用jdk1.7,如<version>3.2.1</version>
而我们一般工程都还停留在jdk1.6,所以我们需要使用其早期版本如<version>3.0-rc5</version>
其实也可以使用官网提供的源代码使用1.6版本进行编译,但源码有问题,最终放弃了。
2.加载问题
加入jpeg包后,java工程main函数跑问题解决了,一切正常,但放web工程tomcat中问题依旧。
Because the ImageIO plugin registry (the IIORegistry) is "VM global", it doesn't by default work well with servlet contexts.
上面是插件官网的说词,需要将下面的代码加入到处理图片的地方即可。
ImageIO.scanForPlugins()
b4d8
javax.imageio.IIOException: Invalid icc profile: duplicate sequence numbers
报异常的图片:
网上有人遇到了同样的异常信息,并使用插件解决了问题: http://stackoverflow.com/questions/32023809/javax-imageio-iioexception-invalid-icc-profile-duplicate-sequence-numbers TwelveMonkeys ImageIO官网地址 http://haraldk.github.io/TwelveMonkeys/#jpeg TwelveMonkeys ImageIO is a collection of plugins and extensions for Java's ImageIO.
These plugins extends the number of image file formats supported in Java, using the javax.imageio.* package. The main purpose of this project is to provide support for formats not covered by the JRE itself.
TwelveMonkeys ImageIO工程主要支持了一些JRE自己没有覆盖到的图片格式。
问题解决方案
1.将相应的格式包导入到工程中,如jpeg
<dependency>
<groupId>com.twelvemonkeys.imageio</groupId>
<artifactId>imageio-jpeg</artifactId>
<version>3.0-rc5</version>
</dependency>
注意版本问题
最新版的插件需要使用jdk1.7,如<version>3.2.1</version>
而我们一般工程都还停留在jdk1.6,所以我们需要使用其早期版本如<version>3.0-rc5</version>
其实也可以使用官网提供的源代码使用1.6版本进行编译,但源码有问题,最终放弃了。
2.加载问题
加入jpeg包后,java工程main函数跑问题解决了,一切正常,但放web工程tomcat中问题依旧。
Because the ImageIO plugin registry (the IIORegistry) is "VM global", it doesn't by default work well with servlet contexts.
上面是插件官网的说词,需要将下面的代码加入到处理图片的地方即可。
ImageIO.scanForPlugins()
b4d8
相关文章推荐
- Invalid icc profile: duplicate sequence numbers
- 关于javax.imageio.IIOException: Invalid icc profile: bad sequence number
- javax.imageio.IIOException: Invalid icc profile: bad sequence number
- ImageIO.read报错:javax.imageio.IIOException: Invalid icc profile: bad sequence number
- invalid byte 1 of 1-byte UTF-8 sequence
- gcc-config: Active gcc profile is invalid解决办法
- hdoj 2817 A sequence of numbers 【快速幂】
- Spring Nested exception: Invalid byte 3 of 3-byte UTF-8 sequence
- 出现invalid byte 1 of 1-byte UTF-8 sequence问题
- postgre的‘invalid UTF-8 byte sequence detected near byte 0x--'错误
- [Caffe] 关于错误Error parsing text-format caffe.NetParameter: 14:17: Invalid escape sequence in string l
- saxReader.read()报org.xml.sax.SAXParseException: Invalid byte 2 of 2-byte UTF-8 sequence.
- spring Invalid byte 1 of 1-byte UTF-8 sequence.
- hdu2817 A sequence of numbers
- 解决Invalid byte 2 of 2-byte UTF-8 sequence (dom4j)
- Cast on a "float" sequence throws InvalidCastException
- ICC Profile
- HDU 2817 A sequence of numbers(数列,简单题)
- Invalid escape sequence (valid ones are \b \t \n \f \r \" \' \\ )
- xml文件报错之Invalid byte 1 of 1-byte UTF-8 sequence.