|
|
@ -34,6 +34,7 @@ public class ImageUtils {
|
|
|
|
.scale(scale) //图片大小(长宽)压缩比例 从0-1,1表示原图
|
|
|
|
.scale(scale) //图片大小(长宽)压缩比例 从0-1,1表示原图
|
|
|
|
.outputQuality(quality) //图片质量压缩比例 从0-1,越接近1质量越好
|
|
|
|
.outputQuality(quality) //图片质量压缩比例 从0-1,越接近1质量越好
|
|
|
|
.toOutputStream(new FileOutputStream(outputImagePath));
|
|
|
|
.toOutputStream(new FileOutputStream(outputImagePath));
|
|
|
|
|
|
|
|
System.out.println("已压缩");
|
|
|
|
} catch (IOException e) {
|
|
|
|
} catch (IOException e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
e.printStackTrace();
|
|
|
|
}
|
|
|
|
}
|
|
|
|