|
@@ -250,7 +250,7 @@ public class FileUploadController extends BaseApiController {
|
|
|
int pHeight = bufferedImage.getHeight();
|
|
|
builder.size(pWidth, pHeight);
|
|
|
double accuracy = CompressUtil.getAccuracy(file.getSize()/1024);
|
|
|
- LogUtil.info(logger, "原始文件长:{0},大小:{1},压缩比:{2}", pWidth, file.getSize()/1024, accuracy);
|
|
|
+ LogUtil.info(logger, "原始文件长:{0},大小:{1},contentType:{2}", pWidth, file.getSize()/1024, mimeType);
|
|
|
|
|
|
String outFileDir = filePath+"/thumb";
|
|
|
File tempFile = new File(outFileDir);
|
|
@@ -265,19 +265,19 @@ public class FileUploadController extends BaseApiController {
|
|
|
if (pWidth > 750) {
|
|
|
float scale = 750f / pWidth;
|
|
|
if ("image/png".equals(file.getContentType())) {
|
|
|
- Thumbnails.of(outFilePath).scale(scale).outputQuality(accuracy)
|
|
|
+ Thumbnails.of(outFilePath).scale(scale).outputQuality(0.7)
|
|
|
.imageType(BufferedImage.TYPE_INT_ARGB).outputFormat("png")
|
|
|
.toFile(outFilePath);
|
|
|
} else {
|
|
|
- Thumbnails.of(outFilePath).scale(scale).outputQuality(accuracy).toFile(outFilePath);
|
|
|
+ Thumbnails.of(outFilePath).scale(scale).outputQuality(0.8).toFile(outFilePath);
|
|
|
}
|
|
|
}else {
|
|
|
if ("image/png".equals(file.getContentType())) {
|
|
|
- Thumbnails.of(outFilePath).scale(1f).outputQuality(accuracy)
|
|
|
+ Thumbnails.of(outFilePath).scale(1f).outputQuality(0.7)
|
|
|
.imageType(BufferedImage.TYPE_INT_ARGB).outputFormat("png")
|
|
|
.toFile(outFilePath);
|
|
|
} else {
|
|
|
- Thumbnails.of(outFilePath).scale(1f).outputQuality(accuracy).toFile(outFilePath);
|
|
|
+ Thumbnails.of(outFilePath).scale(1f).outputQuality(0.8).toFile(outFilePath);
|
|
|
}
|
|
|
}
|
|
|
|