Google Featured

记录精彩的程序人生

目录
java 图片压缩 thumbnailator
/  

java 图片压缩 thumbnailator

1.引入包

        <dependency>
            <groupId>net.coobird</groupId>
            <artifactId>thumbnailator</artifactId>
            <version>0.4.8</version>
        </dependency>

2.使用

float quality = 0.5f;  // 代表压缩的比率
Thumbnails.of(oldPath).scale(1f).outputQuality(quality).toFile(newPath);

标题:java 图片压缩 thumbnailator
作者:liqingyou
地址:https://www.2loveyou.com/articles/2020/01/04/1578115160847.html

评论