|
|
|
@ -134,12 +134,13 @@ public class FileUploadServiceImpl implements IFileUploadService {
|
|
|
|
|
if (!compressFile.getParentFile().exists()) {
|
|
|
|
|
compressFile.getParentFile().mkdirs();
|
|
|
|
|
}
|
|
|
|
|
File compressDest = new File(saveCompressFilePath);
|
|
|
|
|
File compressDest = new File(compressPath);
|
|
|
|
|
BufferedImage image = ImageIO.read(new File(picPath));
|
|
|
|
|
int width = image.getWidth();
|
|
|
|
|
//图片压缩
|
|
|
|
|
ImgUtil.scale(image, FileUtil.file(compressDest), (float) (compressWidth / width));
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
log.error(e.getMessage(), e);
|
|
|
|
|
}finally {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -163,6 +164,7 @@ public class FileUploadServiceImpl implements IFileUploadService {
|
|
|
|
|
//剪切
|
|
|
|
|
ImgUtil.cut(image, FileUtil.file(cutDest), new Rectangle(0, startY, width, endY));
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
log.error(e.getMessage(), e);
|
|
|
|
|
}finally {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|