图片处理 javax.imageio.IIOException: Unsupported Image Type
来源:互联网 发布:网络舆情工作心得体会 编辑:程序博客网 时间:2024/05/02 00:01
用ImageIO处理图片:
- ImagetIO img = ImageIO.read(new File(InputDir + InputFileName));
JPEGImageDecoder decoder = JPEGCodec.createJPEGDecoder(new FileInputStream( new File("e://1.jpg") ) );
BufferedImage sourceImg = decoder.decodeAsBufferedImage();
报异常:
Caused by: javax.imageio.IIOException: Unsupported Image Type
产生原因:
ps或其他软件处理过的图片保存为jpg格式时,默认的模式是CMYK模式(这是给印刷机用的)。在图像-->模式中改为RGB模式才是显示器用的。
http://zhangmingji.iteye.com/blog/1969693
解决办法:方法一:通知用户修改图片格式为RGB。
方法二:用代码在后台转换。
http://iaiai.iteye.com/blog/1461370
参考:http://blog.sina.com.cn/s/blog_600ff075010153wn.html
http://iaiai.iteye.com/blog/1461370
附件为错误测试图片。
http://www.cnblogs.com/yjhrem/articles/3503060.html
http://zhangmingji.iteye.com/blog/1969693
0 0
- 图片处理 javax.imageio.IIOException: Unsupported Image Type
- ImageIO处理图片时Unsupported Image Type
- (转)imageIO异常:Unsupported Image Type, 不支持图像类型
- 解决:Tomcat不能加载图片问题.javax.imageio.IIOException: Can't create cache file!
- javax.imageio.IIOException: Can't create output stream!tomcat 验证码,图片(原理)
- javax.imageio.IIOException: Can't create output stream!tomcat 验证码,图片(原理)
- ImageIO.read(File file) 报异常"Unsupported Image Type",不支持CMYK格式图片问题解析和解决方式
- javax.imageio.IIOException: Can't create output stream!
- javax.imageio.IIOException: Can't create output stream!
- javax.imageio.IIOException: Invalid icc profile: bad sequence number
- 关于javax.imageio.IIOException: Invalid icc profile: bad sequence number
- javax.imageio.IIOException: Can't create output stream!
- javax.imageio.IIOException: Can't create output stream!
- javax.imageio.IIOException: Can't create output stream解决方法
- javax.imageio.IIOException: Can't read input file!
- javax.imageio.IIOException: Can't create output stream解决方法
- javax.imageio.IIOException: Can't read input file!
- 使用javax.imageio.ImageIO生成验证码时报错javax.imageio.IIOException: Can't create output stream!
- leetcode 每日一题 102. Binary Tree Level Order Traversal
- Spring单实例、多线程安全、事务解析
- PHP7 扩展之自动化测试
- spring 事物 线程池 测试
- Android 如何找到最匹配资源
- 图片处理 javax.imageio.IIOException: Unsupported Image Type
- linux tasklet和workqueue的应用情景
- redis sharding方案
- 使用EditText在不同场景下调用软键盘的总结
- MAVEN pom.xml 文件详解,整理学习中··················
- 三色球问题
- sa-jdi.jar
- Java中堆内存和栈内存详解
- openstack 虚拟机添加网卡