start 4.1.2

This commit is contained in:
thinkgem
2018-11-24 20:38:03 +08:00
parent e6fe7b5420
commit 125018df1d
9 changed files with 30 additions and 26 deletions

View File

@@ -118,8 +118,8 @@ public class BinaryUploader {
// 过滤掉gif图片因为gif图片转换后会出现黑色背景的情况gif基本也没有比较大的图片
if (StringUtils.inString(FileUtils.getFileExtension(physicalPath),
"png","jpg","jpeg","bmp","ico")){
Builder<File> file = Thumbnails.of(physicalPath);
BufferedImage bufferedImage = ImageIO.read(new File(physicalPath));
Builder<BufferedImage> file = Thumbnails.of(bufferedImage);
if (bufferedImage != null){
if (bufferedImage.getWidth() <= width){
file.width(bufferedImage.getWidth());