xiongzhu 4 лет назад
Родитель
Сommit
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);
             InputStream is = new ByteArrayInputStream(os.toByteArray());
             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) {
                 height = Integer.MAX_VALUE;
             } else if (width == null) {