From f462d7335567960978e16c5e042c99b54daa94b6 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 12 Dec 2019 11:28:12 +0300 Subject: Cleanup IDEA code issues --- src/main/java/com/juick/server/util/HttpBadRequestException.java | 1 - src/main/java/com/juick/server/util/ImageUtils.java | 6 ++---- 2 files changed, 2 insertions(+), 5 deletions(-) (limited to 'src/main/java/com/juick/server/util') diff --git a/src/main/java/com/juick/server/util/HttpBadRequestException.java b/src/main/java/com/juick/server/util/HttpBadRequestException.java index 242f2b09..892cb203 100644 --- a/src/main/java/com/juick/server/util/HttpBadRequestException.java +++ b/src/main/java/com/juick/server/util/HttpBadRequestException.java @@ -17,7 +17,6 @@ package com.juick.server.util; -import org.apache.commons.lang3.StringUtils; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.ResponseStatus; diff --git a/src/main/java/com/juick/server/util/ImageUtils.java b/src/main/java/com/juick/server/util/ImageUtils.java index 2f5d3292..60bce1a0 100644 --- a/src/main/java/com/juick/server/util/ImageUtils.java +++ b/src/main/java/com/juick/server/util/ImageUtils.java @@ -1,6 +1,5 @@ - /* - * Copyright (C) 2008-2017, Juick + * Copyright (C) 2008-2019, Juick * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as @@ -34,7 +33,6 @@ import org.slf4j.LoggerFactory; import javax.imageio.ImageIO; import javax.imageio.ImageReader; -import javax.imageio.stream.FileImageInputStream; import javax.imageio.stream.ImageInputStream; import java.awt.image.BufferedImage; import java.io.File; @@ -128,7 +126,7 @@ public class ImageUtils { int width = originalImage.getWidth(); int height = originalImage.getHeight(); - int maxDimension = (width > height) ? width : height; + int maxDimension = Math.max(width, height); BufferedImage image1024 = (maxDimension > 1024) ? Scalr.resize(originalImage, 1024) : originalImage; BufferedImage image0512 = (maxDimension > 512) ? Scalr.resize(originalImage, 512) : originalImage; BufferedImage image0160 = (maxDimension > 160) ? Scalr.resize(originalImage, 160) : originalImage; -- cgit v1.2.3