图像文件读写时报错、“com.sun.image.codec.jpeg不存在”
来源:互联网 发布:全球数据公司排名 编辑:程序博客网 时间:2024/06/09 18:50
JPEGImageEncoder类是SUN公司私有类
FileOutputStream out = new FileOutputStream(targetImg);JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);encoder.encode(image);out.close();
替换成
/*FileOutputStream out = new FileOutputStream(targetImg);JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);encoder.encode(image);*/String formatName = targetImg.substring(targetImg.lastIndexOf(".") + 1);ImageIO.write(image,formatName, new File(targetImg));//out.close();
都使用统一的ImageIO进行图像文件的读写
0 0
- 图像文件读写时报错、“com.sun.image.codec.jpeg不存在”
- 程序包com.sun.image.codec.jpeg不存在
- 程序包com.sun.image.codec.jpeg不存在
- 程序包com.sun.image.codec.jpeg不存在
- 关于import com.sun.image.codec.jpeg.JPEGCodec时报错
- maven项目编译时报‘程序包com.sun.image.codec.jpeg不存在’错误
- maven 程序包com.sun.image.codec.jpeg不存在的解决方案
- maven报com.sun.image.codec.jpeg不存在
- 程序包com.sun.image.codec.jpeg不存在解决方法
- 程序包com.sun.image.codec.jpeg不存在 的解决办法
- 【javaee】maven:程序包com.sun.image.codec.jpeg不存在
- maven 程序包com.sun.image.codec.jpeg不存在的解决方案
- 程序包com.sun.image.codec.jpeg不存在’错误
- 报com.sun.image.codec.jpeg不存在 [转]
- com.sun.image.codec.jpeg.JPEGCodec Eclipse报错
- import com.sun.image.codec.jpeg.JPEGCodec报错
- eclipse 导入 com.sun.image.codec.jpeg.JPEGCodec报错
- 图片处理import com.sun.image.codec.jpeg.* 报错
- Android M新控件之FloatingActionButton,TextInputLayout,Snackbar,TabLayout的使用
- backbone如何快捷获取view中el
- iOS开发系列--音频播放、录音、视频播放、拍照、视频录制
- Jquery鼠标右键点击弹出菜单
- d3系列2--api攻坚战01---战前预备
- 图像文件读写时报错、“com.sun.image.codec.jpeg不存在”
- Android安全机制分析与解决方案探析
- Android 获取当前网速质量调整网络请求
- Android开发笔记(七十)反编译初步
- hadoop中namenode中的edit.log文件查看
- 将form表单元素转为实体对象 或集合 -ASP.NET C#
- 减少js对性能的影响
- sdut1309 不老的传说问题(区间dp)
- typedef用法小结