error:LUT has improper length 错误处理
来源:互联网 发布:linux运维面试技巧 编辑:程序博客网 时间:2024/06/01 08:13
使用jdk的ImageIo处理图片缩放,上传原始的没有问题,但是上传处理的就报 error:LUT has improper length,目前根据google的结果,
老外说用了jdk1.5.0.9就没问题了,不过还没试验.
另外,发现上传gif文件时,结果预览图大小为0.
今天尝试了另外一种方法,参照 http://blog.csdn.net/fightplane/archive/2005/01/14/253200.aspx
处理代码段
else if("png".equals(suffix)){
BufferedImage Bi = ImageIO.read(file);
double Ratio = 0.0;
// 假设图片宽 高 最大为120 120
Image Itemp = Bi.getScaledInstance(150, 150, Bi.SCALE_SMOOTH);
if ((Bi.getHeight() > 150) || (Bi.getWidth() > 150)) {
if (Bi.getHeight() > Bi.getWidth())
Ratio = 150.0 / Bi.getHeight();
else
Ratio = 150.0 / Bi.getWidth();
}
AffineTransformOp op = new AffineTransformOp(AffineTransform
.getScaleInstance(Ratio, Ratio), null);
Itemp = op.filter(Bi, null);
try {
ImageIO.write((BufferedImage) Itemp, "png", new File(filesavePath));
} catch (Exception ex) {
System.out.println("-----createZoomSizeImage error ImageIo.write---:"+ ex.getMessage());
log.debug("createZoomSizeImage error:"+ ex.getMessage());
}
}
上传成功
- error:LUT has improper length 错误处理
- keil的错误: Error: Encountered an improper argument 的解决方法
- ERROR L121: IMPROPER FIXUP keil c 51单片机编译错误原因
- boost\asio fatal error C1189: #error : WinSock.h has already been included错误处理
- A fatal error has been detected by the Java Runtime Environment程序错误处理方法
- mysql恢复报ERROR 2006 (HY000) at line 5303856: MySQL server has gone away错误处理
- LUT
- Latex 提示错误"Improper alphabetic constant"
- MySQL中ERROR 1071 (42000): Specified key was too long; max key length is 767 bytes错误的处理
- Axis2客户端Transport error: 411 Error: Length Required 错误解决
- Eclipse 中 An error has occurred 错误
- 错误处理(Error Handling)
- Error Handling 错误处理
- javascript: Error 对象 错误处理
- mysql ERROR 2003 错误处理
- 错误处理(Error Handling)
- Swift错误处理(Error Handling)
- Error-in-javascript 错误处理
- wiki
- c++builder编译器使用技巧大收集!
- 推荐:《Programming ASP.NET中文版》
- 初次编译
- 存储过程和c#调用
- error:LUT has improper length 错误处理
- 如何在 Windows XP 中将 FAT16 或 FAT32 卷转换为 NTFS 文件系统
- TIPS:QTP自带的Recovery场景文件
- R/3 是什么?[转]
- A XMLBean Tip
- Cacls.exe 命令行下修改文件访问控制权限
- Apache2.2.6整合Tomcat6.0.18 (绝对实践过)
- INSTALLSHIELD 12 关于Device Driver wizard 向导无法加载SYS文件问题说明
- IE 下VML动画的奇怪现象:GWTCanvas基于定时器的图形动画当鼠标移动时停止动画效果(直接用VML写代码效果也一样)