Commit f59ded01 by 王祖波

图片压缩

parent 5471d7a6
...@@ -246,8 +246,8 @@ public class MaterialServiceImpl implements MaterialService { ...@@ -246,8 +246,8 @@ public class MaterialServiceImpl implements MaterialService {
String extensions = url.substring(url.lastIndexOf(".") + 1); String extensions = url.substring(url.lastIndexOf(".") + 1);
//朋友圈类型图片,长边不超过10800像素,短边不超过1080像素 //朋友圈类型图片,长边不超过10800像素,短边不超过1080像素
//图片宽高超过限制 或 大小大于2m 处理图片 //图片宽高超过限制 或 大小大于2m 处理图片
if (size / 1000 > 2000 || width > 1080 || height > 10800 || Objects.equals(extensions,"png")) { if (size / 1000 > 2000 || width > 1080 || height > 10800 || (Objects.equals(extensions, "png") && size / 1000 > 1000)) {
url+= "?imageView2/2/w/1080/h/10800/format/jpg" ; url += "?imageView2/2/w/1080/h/10800/format/jpg";
} }
logger.info("url={}",url); logger.info("url={}",url);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment