Commit df54b458 authored by shiyu's avatar shiyu

无旋转的商品不处理

parent aa6599c6
......@@ -87,7 +87,8 @@ public class AdminStorageController {
if (orientationResult.getNeedRepaint()) {
logger.info("当前图片需要进行重绘,旋转角度:【{}】", orientationResult.getAngel());
targetInput = ImgUtil.repaintImage2InputStream(image, orientationResult.getAngel(), orientationResult.getType());
} else {
targetInput = file.getInputStream();
}
} catch (Exception e) {
logger.error("get image size failed : ", e);
......
......@@ -1107,16 +1107,6 @@ public class ItemServiceImpl implements ItemService {
@Override
public Result uploadImage(MultipartFile file) {
try {
/* InputStream inputStream = file.getInputStream();
BufferedImage bufferedImage = ImageIO.read(inputStream);*/
/* String lastKey = ".jpg";
if (StringUtils.isNotBlank(file.getOriginalFilename())) {
lastKey = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
}
String keyName = CommConsts.UPLOAD_PRE_DIRECTORY + CommonUtils.getUUID() + "_" + bufferedImage.getWidth() + "x" + bufferedImage.getHeight() + lastKey;
InputStream imageStream = bufferedImageToInputStream(bufferedImage, lastKey.substring(1));
qiniuStorage.store(imageStream, file.getSize(), file.getContentType(), keyName);*/
InputStream targetInput = null;
try (InputStream inputStream = file.getInputStream()) {
BufferedImage image = ImageIO.read(inputStream);
......@@ -1124,7 +1114,8 @@ public class ItemServiceImpl implements ItemService {
if (orientationResult.getNeedRepaint()) {
logger.info("当前图片需要进行重绘,旋转角度:【{}】", orientationResult.getAngel());
targetInput = ImgUtil.repaintImage2InputStream(image, orientationResult.getAngel(), orientationResult.getType());
} else {
targetInput = file.getInputStream();
}
} catch (Exception e) {
logger.error("get image size failed : ", e);
......
......@@ -89,12 +89,12 @@ public class WxStorageController {
if (orientationResult.getNeedRepaint()) {
logger.info("当前图片需要进行重绘,旋转角度:【{}】", orientationResult.getAngel());
targetInput = ImgUtil.repaintImage2InputStream(image, orientationResult.getAngel(), orientationResult.getType());
} else {
targetInput = file.getInputStream();
}
} catch (Exception e) {
logger.error("get image size failed : ", e);
}
String url = storageService.store(targetInput, file.getSize(), file.getContentType(), originalFilename);
Map<String, Object> data = new HashMap<>();
data.put("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