diff options
author | Vitaly Takmazov | 2019-12-12 11:28:12 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2019-12-12 11:28:12 +0300 |
commit | f462d7335567960978e16c5e042c99b54daa94b6 (patch) | |
tree | f298f3ac50ed64d0292bba0a8a6e148e8daa434c /src/main/java/com/juick/server/util | |
parent | c0ae480bb5c07ea7b9e1b42df428e2857b0d4816 (diff) |
Cleanup IDEA code issues
Diffstat (limited to 'src/main/java/com/juick/server/util')
-rw-r--r-- | src/main/java/com/juick/server/util/HttpBadRequestException.java | 1 | ||||
-rw-r--r-- | src/main/java/com/juick/server/util/ImageUtils.java | 6 |
2 files changed, 2 insertions, 5 deletions
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; |