|
@@ -51,7 +51,7 @@ public class ProduceServiceImpl implements ProducerService {
|
|
|
Long userId = JwtUtil.getUserId(request.getHeader("token"));
|
|
|
long start = System.currentTimeMillis();
|
|
|
// 全景图只支持jpg图片格式
|
|
|
-// checkImg(file);
|
|
|
+ checkImg(file);
|
|
|
|
|
|
long kb = fileUtils.getSize(file, "kB");
|
|
|
BaseRuntimeException.isHas((kb/1024) >=120, null, "全景图文件不能超过120MB");
|
|
@@ -121,11 +121,11 @@ public class ProduceServiceImpl implements ProducerService {
|
|
|
BaseRuntimeException.isHas(!jpg, null, msg);
|
|
|
|
|
|
// 检查2:1图片
|
|
|
- BufferedImage read = cn.hutool.core.img.ImgUtil.read(file.getInputStream());
|
|
|
- int width = read.getWidth();
|
|
|
- int height = read.getHeight();
|
|
|
- BaseRuntimeException.isHas(!(width/height == 2), null, "非2:1图片");
|
|
|
- log.info("校验图片完成");
|
|
|
+// BufferedImage read = cn.hutool.core.img.ImgUtil.read(file.getInputStream());
|
|
|
+// int width = read.getWidth();
|
|
|
+// int height = read.getHeight();
|
|
|
+// BaseRuntimeException.isHas(!(width/height == 2), null, "非2:1图片");
|
|
|
+// log.info("校验图片完成");
|
|
|
|
|
|
} catch (IOException e) {
|
|
|
e.printStackTrace();
|