|
|
@@ -82,10 +82,10 @@ public class InsUploadFilesServiceImpl extends ServiceImpl<InsUploadFilesMapper,
|
|
|
try (FileOutputStream fileOutputStream = new FileOutputStream(file)) {
|
|
|
if (FileType.IMAGE.getType().equals(type)) {
|
|
|
// 图片格式需要压缩.
|
|
|
-// multipartFile.transferTo(new File(uploadPath));
|
|
|
-// byte[] compressPicByte = ImageCompressionUtils.compressPic(multipartFile.getInputStream(), suffix, uploadFilePath);
|
|
|
+ multipartFile.transferTo(new File(uploadPath));
|
|
|
+ byte[] compressPicByte = ImageCompressionUtils.compressPic(multipartFile.getInputStream(), suffix, uploadFilePath);
|
|
|
// byte[] bytes = ImageCompressionUtils.compressPicForScale(compressPicByte, 100);
|
|
|
- fileOutputStream.write(multipartFile.getBytes());
|
|
|
+ fileOutputStream.write(compressPicByte);
|
|
|
} else {
|
|
|
fileOutputStream.write(multipartFile.getBytes());
|
|
|
}
|