Skip to content

Commit

Permalink
Merge pull request #270 from Travel-in-nanaland/hotfix/#269-s3-thumbn…
Browse files Browse the repository at this point in the history
…ail-ratio

[#269] hotfix: s3ImageService 썸네일 높이 aspectRatio 0일 경우 450 반환
  • Loading branch information
Te-H0 authored Jul 1, 2024
2 parents d7e3562 + d48c865 commit 053ace8
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}

0 comments on commit 053ace8

Please sign in to comment.