Skip to content

Commit

Permalink
fix image thumbnail bug
Browse files Browse the repository at this point in the history
Signed-off-by: fanyinbo <[email protected]>
  • Loading branch information
fanyinbo committed Dec 19, 2023
1 parent 657988d commit 035ca6a
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -830,9 +830,10 @@ private void createUploadThumbnail(Long userId, List<FileBO> fileBOS, String roo
var suffix = FileUtil.getSuffix(fileName);
suffix = suffix.equalsIgnoreCase(TIFF_SUFFIX) || suffix.equalsIgnoreCase(TIF_SUFFIX) ? "jpg" : suffix;
var prefix = FileUtil.getPrefix(fileName);
var largeFile = FileUtil.file(tempPath, String.format("%s_%s.%s", prefix, large, suffix));
var mediumFile = FileUtil.file(tempPath, String.format("%s_%s.%s", prefix, medium, suffix));
var smallFile = FileUtil.file(tempPath, String.format("%s_%s.%s", prefix, small, suffix));
var baseSavePath = file.getParentFile().getAbsolutePath();
var largeFile = FileUtil.file(baseSavePath, String.format("%s_%s.%s", prefix, large, suffix));
var mediumFile = FileUtil.file(baseSavePath, String.format("%s_%s.%s", prefix, medium, suffix));
var smallFile = FileUtil.file(baseSavePath, String.format("%s_%s.%s", prefix, small, suffix));
Thumbnails.of(file).size(largeFileSize, largeFileSize).toFile(largeFile);
Thumbnails.of(largeFile).size(mediumFileSize, mediumFileSize).toFile(mediumFile);
Thumbnails.of(largeFile).size(smallFileSize, smallFileSize).toFile(smallFile);
Expand Down

0 comments on commit 035ca6a

Please sign in to comment.