xiongzhu 4 年之前
父節點
當前提交
bdd13616f1
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/main/java/com/izouma/nineth/web/FileUploadController.java

+ 1 - 1
src/main/java/com/izouma/nineth/web/FileUploadController.java

@@ -161,7 +161,7 @@ public class FileUploadController {
             ImageIO.write(img, ext, os);
             ImageIO.write(img, ext, os);
             InputStream is = new ByteArrayInputStream(os.toByteArray());
             InputStream is = new ByteArrayInputStream(os.toByteArray());
             url = storageService.uploadFromInputStream(is, path);
             url = storageService.uploadFromInputStream(is, path);
-        } else if (width != null || height != null) {
+        } else if (Pattern.matches("(jpg|png)", ext) && (width != null || height != null)) {
             if (height == null) {
             if (height == null) {
                 height = Integer.MAX_VALUE;
                 height = Integer.MAX_VALUE;
             } else if (width == null) {
             } else if (width == null) {