安装
<dependency>
<groupId>com.sunquakes</groupId>
<artifactId>resizer</artifactId>
<version>0.2.0</version>
</dependency>
// https://mvnrepository.com/artifact/com.sunquakes/resizer
compile group: 'com.sunquakes', name: 'resizer', version: '0.2.0'
开始使用
引入包
import com.sunquakes.resizer.Image;
用法
byte[] inImageByteArray = ...;
byte[] outImageByteArray = Image.scaleRange(inImageByteArray, 100 * 1024, 200 * 1024);
String inImagePathname = "/path/to/image";
byte[] outImageByteArray = Image.scaleRange(inImagePathname, 100 * 1024, 200 * 1024);
项目地址
https://github.com/sunquakes/resizer