java中使用thumbnailator实现图片压缩
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"));
}
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 |
cat /etc/motd
# 动力火车/黑客帝国/鱼缸/奶牛
brew install sl cmatrix asciiquarium cowsay
cowsay "aaaa"
写字楼里写字间,写字间里程序员;程序人员写程序,又拿程序换酒钱。
酒醒只在网上坐,酒醉还来网下眠;酒醉酒醒日复日,网上网下年复年。
宁愿老死程序间,只要老板多发钱;小车大房不去想,撰个二千好过年。
若要见识新世面,公务员比程序员;一个在天一在地,而且还比我们闲。
别人看我穿白领,我看别人穿名牌;天生我才写程序,臀大近视肩周炎。
年复一年春光度,度得他人做老板;老板扣我薄酒钱,没有酒钱怎过年。
春光逝去皱纹起,作起程序也委靡;来到水源把水灌,打死不做程序员。
别人笑我忒疯癫,我笑他人命太贱;状元三百六十行,偏偏来做程序员。
但愿老死电脑间,不愿鞠躬老板前;奔驰宝马贵者趣,公交自行程序员。
别人笑我忒疯癫,我笑自己命太贱;不见满街漂亮妹,哪个归得程序员。
不想只挣打工钱,那个老板愿发钱;小车大房咱要想,任我享用多悠闲。
比尔能搞个微软,我咋不能捞点钱;一个在天一在地,定有一日乾坤翻。
我在天来他在地,纵横天下山水间;傲视武林豪杰墓,一樽还垒风月山。
电脑面前眼发直,眼镜下面泪茫茫;做梦发财好几亿,从此不用手指忙。
哪知梦醒手空空,老板看到把我训;待到老时眼发花,走路不知哪是家。
小农村里小民房,小民房里小民工;小民工人写程序,又拿代码讨赏钱。
钱空只在代码中,钱醉仍在代码间;有钱无钱日复日,码上码下年复年。
但愿老死代码间,不愿鞠躬奥迪前,奥迪奔驰贵者趣,程序代码贫者缘。
若将贫贱比贫者,一在平地一在天;若将贫贱比车马,他得驱驰我得闲。
别人笑我忒疯癫,我笑他人看不穿;不见盖茨两手间,财权富贵世人鉴。
oOoo_
o8888888o
88" . "88
(| -_- |)
O\ = /O
____/`---'\____
. ' \\| | `.
/ \\||| : ||| \
/ _||||| -:- |||||- \
| | \\\ - / | |
| \_| ''\---/'' | |
\ .-\__ `-` ___/-. /
___`. .' /--.--\ `. . __
."" '< `.___\_<|>_/___.' >'"".
| | : `- \`.;`\ _ /`;.`/ - ` : | |
\ \ `-. \_ __\ /__ _/ .-` / /
======`-.____`-.___\_____/___.-`____.-'======
`=---='
.............................................
佛祖镇楼 BUG辟易
佛曰:
写字楼里写字间,写字间里程序员;
程序人员写程序,又拿程序换酒钱。
酒醒只在网上坐,酒醉还来网下眠;
酒醉酒醒日复日,网上网下年复年。
但愿老死电脑间,不愿鞠躬老板前;
奔驰宝马贵者趣,公交自行程序员。
别人笑我忒疯癫,我笑自己命太贱;
不见满街漂亮妹,哪个归得程序员?