imgscalr 是一个对图片进行缩放的 Java 类库。
示例代码:
import static org.imgscalr.Scalr.*; public static BufferedImage createThumbnail(BufferedImage img) { // Create quickly, then smooth and brighten it. img = resize(img, Method.SPEED, 125, OP_ANTIALIAS, OP_BRIGHTER); // Let's add a little border before we return result. return pad(img, 4); }