I get unexpected results when I try to read and save 512x512 piece from JPEG image:
- Code: Select all
public class TestReader {
public static void main(String[] args) throws FormatException, IOException {
ImageReader tr = new ImageReader();
tr.setId("E:/tmp/T1_3_1_SST11D_0159.jpg");
BufferedImageReader bir = new BufferedImageReader(tr);
BufferedImage bi = bir.openImage(0, 10000, 10000, 512, 512);
File outputfile = new File("saved.png");
ImageIO.write(bi, "png", outputfile);
bir.close();
}
}
The input file: http://folk.uio.no/dmitrd/bio-formats/T ... D_0059.jpg
Version 5.7.1, W764