From f4e93f52a67a04946d9e192de7f32e987bf2507b Mon Sep 17 00:00:00 2001 From: sidheshenator Date: Thu, 21 May 2015 11:45:43 -0400 Subject: [PATCH] replace ternary operator with Math.min() --- Core/src/org/sleuthkit/autopsy/coreutils/ImageUtils.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/coreutils/ImageUtils.java b/Core/src/org/sleuthkit/autopsy/coreutils/ImageUtils.java index b4d89e5a9d..f8ad010859 100755 --- a/Core/src/org/sleuthkit/autopsy/coreutils/ImageUtils.java +++ b/Core/src/org/sleuthkit/autopsy/coreutils/ImageUtils.java @@ -273,8 +273,7 @@ public class ImageUtils { } catch (IllegalArgumentException e) { // if resizing does not work due to extremely small height/width ratio, // crop the image instead. - BufferedImage biCropped = ScalrWrapper.cropImage(bi, iconSize > bi.getWidth() ? - bi.getWidth() : iconSize, iconSize > bi.getHeight() ? bi.getHeight() : iconSize); + BufferedImage biCropped = ScalrWrapper.cropImage(bi, Math.min(iconSize, bi.getWidth()), Math.min(iconSize, bi.getHeight())); return biCropped; } catch (OutOfMemoryError e) {