BUGFIX:获取all pose的预览地址报错
This commit is contained in:
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user