在下面的代码中,我的源图像的dpi为600,但结果图像的dpi为96,为什么?
RenderedOp source = JAI.create("fileload", "img/1.jpg");
FileOutputStream outputStream = new FileOutputStream("img/new1.jpg");
JAI.create("encode", source, outputStream, "JPEG", null);
JAI.create("filestore", source, "img/new1.jpg", "JPEG", null);
答案 0 :(得分:0)
我找到了解决方案:
ImageInputStream iis = ImageIO.createImageInputStream(new File("img/1.jpg"));
ImageOutputStream ios = ImageIO.createImageOutputStream(new File("img/new1.jpg"));
Integer b = null;
while ((b = iis.read()) != -1) {
ios.write(b);
}