【发布时间】:2013-05-07 22:17:09
【问题描述】:
使用以下代码上传图片。
ByteArrayOutputStream baos = new ByteArrayOutputStream();
BufferedImage img = ImageIO.read(new File("abc.tiff"));
ImageIO.write(img, "tiff", baos);
img.flush();
img=null;
byte[] bytes2 = baos.toByteArray();
if(baos != null) {
baos.flush();
baos.close();
}
System.out.println("bytes2 size::::" + bytes2.length);
我的原始 tiff 图像大小为 119 kb,当我打印图像字节时,我得到 800974 字节长度。
为什么图片尺寸变大了?可能是什么问题
【问题讨论】:
标签: java image image-processing tiff