public static void main(String args[]) throws IOException {
// 原始比例大小,0.5倍清晰度
Thumbnails.of(new File("original.jpg")).scale(1f).outputQuality(0.5f).toFile(new File("thumbnail.jpg"));
}
package example;
import com.luciad.imageio.webp.WebPReadParam;
import javax.imageio.ImageIO;
import javax.imageio.ImageReader;
import javax.imageio.stream.FileImageInputStream;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
public class DecodeTest {
public static void main(String args[]) throws IOException {
String inputWebpPath = "test_pic/test.webp";
String outputJpgPath = "test_pic/test_.jpg";
String outputJpegPath = "test_pic/test_.jpeg";
String outputPngPath = "test_pic/test_.png";
// Obtain a WebP ImageReader instance
ImageReader reader = ImageIO.getImageReadersByMIMEType("image/webp").next();
// Configure decoding parameters
WebPReadParam readParam = new WebPReadParam();
readParam.setBypassFiltering(true);
// Configure the input on the ImageReader
reader.setInput(new FileImageInputStream(new File(inputWebpPath)));
// Decode the image
BufferedImage image = reader.read(0, readParam);
ImageIO.write(image, "png", new File(outputPngPath));
ImageIO.write(image, "jpg", new File(outputJpgPath));
ImageIO.write(image, "jpeg", new File(outputJpegPath));
}
}
基于 github-awesome-ops-system 整理
整理时间: 2024-06-01
Name | Github | Star | Last update |
---|---|---|---|
LuBan运维平台 | https://github.com/dnsjia/luban | 1.2k | 5 months ago |
蓝鲸持续集成平台(蓝盾) | https://github.com/TencentBlueKing/bk-ci | 2.3k | 2 days ago |
CODO | https://github.com/opendevops-cn/opendevops | 3.7k | last year |
Syncd - 自动化部署工具 | https://github.com/dreamans/syncd | 2.2k | 2 years ago |
walle 2.0 瓦力 | https://github.com/meolu/walle-web | 11.8k | 3 years ago |
adminset | https://github.com/guohongze/adminset | 3.2k | 4 years ago |
wayne | https://github.com/Qihoo360/wayne | 3.7k | 2 years ago |
rainbond | https://github.com/goodrain/rainbond | 4.8k | 3 months ago |
kubesphere | https://github.com/kubesphere/kubesphere | 14.5k | 3 weeks ago |