验证环境生成缩略图测试ok提交
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-04-03 13:49:34 +08:00
parent 9149dd6cf6
commit e9e5075c1c
2 changed files with 75 additions and 5 deletions
@@ -15,14 +15,20 @@ public static class ImageHelper
fileStorePath = fileStorePath ?? filePath + ".preview.jpeg";
using (var image = SixLabors.ImageSharp.Image.Load(filePath))
{
// 读取 DICOM 文件
var dicomImage = new DicomImage(filePath);
// 渲染 DICOM 图像到 ImageSharp 格式
using (var image = dicomImage.RenderImage().AsSharpImage())
{
// 生成缩略图(调整大小)
image.Mutate(x => x.Resize(500, 500));
image.Save(fileStorePath);
// 保存缩略图为 JPEG
image.Save(fileStorePath, new JpegEncoder());
}
}