修改文件类型 和优先级设置

This commit is contained in:
2026-05-08 17:04:00 +08:00
parent 7957a33fc4
commit 3200c71996
5 changed files with 123 additions and 15 deletions
+1 -1
View File
@@ -1057,7 +1057,7 @@ public class OSSService(IOptionsMonitor<ObjectStoreServiceOptions> options,
uploadInfo.FileSize = fileSize;
uploadInfo.Path = returnPath;
uploadInfo.FileName = Path.GetFileName(localFilePath);
uploadInfo.FileType = Path.GetExtension(returnPath);
uploadInfo.FileType = Path.GetExtension(returnPath).TrimStart(".");
await _fileUploadRecordService.AddOrUpdateFileUploadRecord(uploadInfo);
@@ -237,6 +237,20 @@ public static class DicomPixelMasker
{
workingDataset.AddOrUpdate(DicomTag.BurnedInAnnotation, "NO");
}
//// 转 JPEG Baseline(最稳定)
//var transcoder = new DicomTranscoder(
// DicomTransferSyntax.ExplicitVRLittleEndian,
// DicomTransferSyntax.JPEGProcess1);
//var finalFile = await Task.Run(
// () => transcoder.Transcode(workingFile),
// cancellationToken).ConfigureAwait(false);
//if (output.CanSeek)
// output.SetLength(0);
//await finalFile.SaveAsync(output).ConfigureAwait(false);
// 不要把 original photometric 强行写回
var finalFile = await ReEncodeToOriginalTransferSyntaxAsync(
workingFile,
@@ -422,17 +436,26 @@ public static class DicomPixelMasker
DicomPixelData sourcePixelData,
IReadOnlyList<IByteBuffer> frames)
{
//dataset.Remove(DicomTag.PixelData);
//var newPixelData = DicomPixelData.Create(dataset, true);
////newPixelData.BitsAllocated = sourcePixelData.BitsAllocated;
//newPixelData.BitsStored = sourcePixelData.BitsStored;
//newPixelData.HighBit = sourcePixelData.HighBit;
//newPixelData.SamplesPerPixel = sourcePixelData.SamplesPerPixel;
//newPixelData.PixelRepresentation = sourcePixelData.PixelRepresentation;
//newPixelData.PlanarConfiguration = sourcePixelData.PlanarConfiguration;
//newPixelData.Height = sourcePixelData.Height;
//newPixelData.Width = sourcePixelData.Width;
//newPixelData.PhotometricInterpretation = sourcePixelData.PhotometricInterpretation;
//foreach (var frame in frames)
//{
// newPixelData.AddFrame(frame);
//}
dataset.Remove(DicomTag.PixelData);
var newPixelData = DicomPixelData.Create(dataset, true);
//newPixelData.BitsAllocated = sourcePixelData.BitsAllocated;
newPixelData.BitsStored = sourcePixelData.BitsStored;
newPixelData.HighBit = sourcePixelData.HighBit;
newPixelData.SamplesPerPixel = sourcePixelData.SamplesPerPixel;
newPixelData.PixelRepresentation = sourcePixelData.PixelRepresentation;
newPixelData.PlanarConfiguration = sourcePixelData.PlanarConfiguration;
newPixelData.Height = sourcePixelData.Height;
newPixelData.Width = sourcePixelData.Width;
newPixelData.PhotometricInterpretation = sourcePixelData.PhotometricInterpretation;
foreach (var frame in frames)
{
newPixelData.AddFrame(frame);