|
@@ -164,20 +164,20 @@ public class FodderServiceImpl extends IBaseServiceImpl<FodderEntity, Long> impl
|
|
|
|
|
|
if (type.equals("image")) {
|
|
|
// 2022-10-27,图片大于1MB生成缩略图, 小于1MB使用原图作为缩略图
|
|
|
-// if (size > 1024){
|
|
|
-// savePath = savePath + "/fodder/image/" + newName;
|
|
|
-// log.info("savePath: {}", savePath);
|
|
|
-// FileUtil.writeFromStream(file.getInputStream(), savePath);
|
|
|
-// iconPath = convertAndUploadOss(
|
|
|
-// savePath, configConstant.ossBasePath + "fodder", configConstant.ossDomain, 800, 800, "/thumb_" + newName);
|
|
|
-// log.info("图片压缩完成");
|
|
|
-//
|
|
|
-// } else {
|
|
|
-// iconPath = ossUrl;
|
|
|
-// }
|
|
|
+ if (size > 1024){
|
|
|
+ savePath = savePath + "/fodder/image/" + newName;
|
|
|
+ log.info("savePath: {}", savePath);
|
|
|
+ FileUtil.writeFromStream(file.getInputStream(), savePath);
|
|
|
+ iconPath = convertAndUploadOss(
|
|
|
+ savePath, configConstant.ossBasePath + "fodder", configConstant.ossDomain, 800, 800, "/thumb_" + newName);
|
|
|
+ log.info("图片压缩完成");
|
|
|
+
|
|
|
+ } else {
|
|
|
+ iconPath = ossUrl;
|
|
|
+ }
|
|
|
|
|
|
// 2022-11-02 素材库缩略图不需要压缩, 前端使用oss截取缩略图。 当图片过大自定义logo时, 生成二维码会变慢
|
|
|
- iconPath = ossUrl;
|
|
|
+// iconPath = ossUrl;
|
|
|
|
|
|
// todo 这个是很耗新能的,如果新能有问题,改用前端
|
|
|
dpi = ImageUtil.dpi(file);
|