BUGFIX:获取all pose的预览地址报错

This commit is contained in:
2025-06-20 12:01:17 +08:00
parent 6b165fe5bc
commit 92278cf91b
2 changed files with 10 additions and 3 deletions

View File

@@ -377,7 +377,8 @@ public class MinioUtil {
try {
String lowerName = fileName.toLowerCase();
boolean isImage = lowerName.endsWith(".jpg") || lowerName.endsWith(".jpeg") || lowerName.endsWith(".png");
boolean isImage = lowerName.endsWith(".jpg") || lowerName.endsWith(".jpeg")
|| lowerName.endsWith(".png") || lowerName.endsWith(".gif");
GetPresignedObjectUrlArgs.Builder builder = GetPresignedObjectUrlArgs.builder()
.bucket(bucketName)
@@ -390,6 +391,8 @@ public class MinioUtil {
String contentType = "image/jpeg";
if (lowerName.endsWith(".png")) {
contentType = "image/png";
} else if (lowerName.endsWith(".gif")) { // 新增 GIF
contentType = "image/gif";
}
Map<String, String> queryParams = new HashMap<>();
@@ -400,8 +403,10 @@ public class MinioUtil {
}
return minioClient.getPresignedObjectUrl(builder.build());
} catch (MinioException | InvalidKeyException | IOException | NoSuchAlgorithmException e) {
} catch (MinioException | InvalidKeyException
| IOException | NoSuchAlgorithmException | IllegalArgumentException e) {
e.printStackTrace();
log.error("bucket: {}, object:{}", bucketName, fileName);
throw new BusinessException(e.getMessage());
}
}