File sourceFile = new File("F:\\1.png"); File targetFile = new File("F:\\2.png"); Thumbnails.of(sourceFile).scale(0.3f).toFile(targetFile);
<dependency> <groupId>net.coobird</groupId> <artifactId>thumbnailator</artifactId> <version>0.4.14</version> </dependency>
标签:java,压缩,sourceFile,targetFile,File,new,png,图片 From: https://www.cnblogs.com/weixingbo/p/16857452.html