Thumbnailator-0.3.10-all.jar 这个jar包
//缩略图
int width = 80;
int height = 60;
File in = new File("C:\\Users\\zhanglong.zhanglong-PC\\Desktop\\photo\\e5d0e1c1f9ea92ace6e740676899a9d0.jpg");
File out = new File("C:\\Users\\zhanglong.zhanglong-PC\\Desktop\\photo\\koala.jpg");
try {
//我设置了生成小图片的大小,并不一定会按照我设置的大小去生成图片,内部有一个比例的。
//Thumbnailator类有很多方法,根据参数去传入参数
Thumbnailator.createThumbnail(in, out, width, height);
} catch (IOException e) {
e.printStackTrace();
}