xiongzhu 4 years ago
parent
commit
bdd13616f1
1 changed files with 1 additions and 1 deletions
  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) {