STUDY/Java
Java | MultipartFile image width와 height 알아내기
개미606
2021. 3. 25. 14:59
private void checkImageSize(MultipartFile file) {
try {
BufferedImage bufferedImage = ImageIO.read(file.getInputStream());
int width = bufferedImage.getWidth();
int height = bufferedImage.getHeight();
System.out.println(String.format("width = %d height = %d", width, height));
} catch (IOException e) {
e.printStackTrace();
}
}