修改接收文件bug
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
6a9f791b1b
commit
4d8b43f8df
|
|
@ -728,7 +728,7 @@ namespace IRaCIS.Core.SCP.Service
|
||||||
|
|
||||||
// 上传缩略图到 OSS
|
// 上传缩略图到 OSS
|
||||||
|
|
||||||
var seriesPath = await ossService.UploadToOSSAsync(memoryStream, ossFolderPath, seriesId.ToString() + ".preview.jpg", false);
|
var seriesPath = await ossService.UploadToOSSAsync(memoryStream, ossFolderPath, $"{seriesId.ToString()}_{instanceId.ToString()}.preview.jpg", false);
|
||||||
|
|
||||||
Console.WriteLine(seriesPath + " Id: " + seriesId);
|
Console.WriteLine(seriesPath + " Id: " + seriesId);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
using Aliyun.OSS;
|
using Aliyun.OSS;
|
||||||
|
using DocumentFormat.OpenXml.Bibliography;
|
||||||
using FellowOakDicom;
|
using FellowOakDicom;
|
||||||
using FellowOakDicom.Imaging;
|
using FellowOakDicom.Imaging;
|
||||||
using IRaCIS.Application.Contracts;
|
using IRaCIS.Application.Contracts;
|
||||||
|
|
@ -27,6 +28,7 @@ using Microsoft.Extensions.Options;
|
||||||
using MiniExcelLibs;
|
using MiniExcelLibs;
|
||||||
using NPOI.SS.Formula.Functions;
|
using NPOI.SS.Formula.Functions;
|
||||||
using NPOI.XWPF.UserModel;
|
using NPOI.XWPF.UserModel;
|
||||||
|
using SixLabors.ImageSharp.Formats.Jpeg;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
@ -57,6 +59,31 @@ namespace IRaCIS.Core.Application.Service
|
||||||
public static int IntValue = 100;
|
public static int IntValue = 100;
|
||||||
|
|
||||||
|
|
||||||
|
public async Task<IResponseOutput> TestImage(string fileFullPath)
|
||||||
|
{
|
||||||
|
var file = await DicomFile.OpenAsync(fileFullPath);
|
||||||
|
// 生成缩略图
|
||||||
|
using (var memoryStream = new MemoryStream())
|
||||||
|
{
|
||||||
|
DicomImage image = new DicomImage(file.Dataset);
|
||||||
|
|
||||||
|
var sharpimage = image.RenderImage().AsSharpImage();
|
||||||
|
sharpimage.Save(memoryStream, new JpegEncoder());
|
||||||
|
|
||||||
|
|
||||||
|
// 关键点:一定要回到开头
|
||||||
|
memoryStream.Position = 0;
|
||||||
|
|
||||||
|
using (var fileStream = File.Create($"{fileFullPath}.jpg"))
|
||||||
|
{
|
||||||
|
await memoryStream.CopyToAsync(fileStream);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return ResponseOutput.Ok();
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 维护dir 需求新增的字段
|
/// 维护dir 需求新增的字段
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue