图片可指定格式,可推荐格式,压缩

This commit is contained in:
2025-03-19 17:56:18 +08:00
parent fd85b7ad77
commit a8601548c6
5 changed files with 104 additions and 12 deletions

View File

@ -505,7 +505,7 @@ public class GoodsServiceImpl implements GoodsService {
} else {
// 生成
File dstFile = new File(item.getGoodsId() + ".jpg");
File watermarkedFile = new File(item.getGoodsId() + "_" + ImageWatermarkOperatorEnum.WATERMARK.getType() + ".png");
File watermarkedFile = new File(item.getGoodsId() + "_" + ImageWatermarkOperatorEnum.WATERMARK.getType() + "." + ImageWatermarkOperatorEnum.WATERMARK.getPreferFileType());
try {
HttpUtil.downloadFile(item.getUrl().replace("oss.zhentuai.com", "frametour-assets.oss-cn-shanghai-internal.aliyuncs.com"), dstFile);
} catch (Exception e) {
@ -613,7 +613,7 @@ public class GoodsServiceImpl implements GoodsService {
} else {
// 生成
File dstFile = new File(item.getGoodsId() + ".jpg");
File watermarkedFile = new File(item.getGoodsId() + "_" + type.getType() + ".png");
File watermarkedFile = new File(item.getGoodsId() + "_" + type.getType() + "." + type.getPreferFileType());
try {
HttpUtil.downloadFile(item.getUrl().replace("oss.zhentuai.com", "frametour-assets.oss-cn-shanghai-internal.aliyuncs.com"), dstFile);
} catch (Exception e) {