replace ternary operator with Math.min()

This commit is contained in:
sidheshenator
2015-05-21 11:45:43 -04:00
parent 1c6f612588
commit f4e93f52a6
@@ -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) {