From d48c86568cd9fda34cd0a47489de0314ed6ffec3 Mon Sep 17 00:00:00 2001 From: teho Date: Mon, 1 Jul 2024 22:41:48 +0900 Subject: [PATCH] =?UTF-8?q?[#269]=20hotfix:=20s3ImageService=20=EC=8D=B8?= =?UTF-8?q?=EB=84=A4=EC=9D=BC=20=EB=86=92=EC=9D=B4=20aspectRatio=200?= =?UTF-8?q?=EC=9D=BC=20=EA=B2=BD=EC=9A=B0=20450=20=EB=B0=98=ED=99=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jeju/nanaland/global/image_upload/S3ImageService.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/jeju/nanaland/global/image_upload/S3ImageService.java b/src/main/java/com/jeju/nanaland/global/image_upload/S3ImageService.java index 3d081858..7e6f1775 100644 --- a/src/main/java/com/jeju/nanaland/global/image_upload/S3ImageService.java +++ b/src/main/java/com/jeju/nanaland/global/image_upload/S3ImageService.java @@ -228,7 +228,10 @@ private int getResizeImageHeight(MultipartFile file) throws IOException { int originalHeight = bufferedImage.getHeight(); int originalWidth = bufferedImage.getWidth(); int aspectRatio = originalHeight / originalWidth; - - return 600 * aspectRatio; + if (aspectRatio == 0) { + return 450; + } else { + return 600 * aspectRatio; + } } }