Browse Source

测试io-5

wuweihao 3 năm trước cách đây
mục cha
commit
1b228d901a

+ 8 - 1
720yun_local_manage/gis_common/src/main/java/com/gis/common/util/ImgUtils.java

@@ -9,8 +9,12 @@ import org.apache.commons.lang3.StringUtils;
 import org.springframework.web.multipart.MultipartFile;
 
 import javax.imageio.ImageIO;
+import javax.imageio.ImageReadParam;
+import javax.imageio.ImageReader;
+import javax.imageio.stream.ImageInputStream;
 import java.awt.image.BufferedImage;
 import java.io.IOException;
+import java.util.Iterator;
 
 /**
  * Created by owen on 2022/3/23 0023 17:48
@@ -71,7 +75,7 @@ public class ImgUtils {
      */
     public static void checkImgRatio(MultipartFile file){
         try {
-
+            ImageIO.setUseCache(false);
             BufferedImage read = ImageIO.read(file.getInputStream());
             int width = read.getWidth();
             int height = read.getHeight();
@@ -85,4 +89,7 @@ public class ImgUtils {
     }
 
 
+
+
+
 }