From 396eaf7e686d0ffc976e29b122d8f216b2952026 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Thu, 19 May 2022 17:28:24 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=A9=E7=95=A5=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/QC/NoneDicomStudyService.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/IRaCIS.Core.Application/Service/QC/NoneDicomStudyService.cs b/IRaCIS.Core.Application/Service/QC/NoneDicomStudyService.cs index 40bc443d..34785c39 100644 --- a/IRaCIS.Core.Application/Service/QC/NoneDicomStudyService.cs +++ b/IRaCIS.Core.Application/Service/QC/NoneDicomStudyService.cs @@ -17,6 +17,7 @@ using IRaCIS.Core.Infrastructure; using SixLabors.ImageSharp.Processing; using SixLabors.ImageSharp; using Microsoft.Extensions.Logging; +using Microsoft.AspNetCore.Authorization; namespace IRaCIS.Core.Application.Contracts { @@ -211,7 +212,7 @@ namespace IRaCIS.Core.Application.Contracts return await _repository.Where(t => t.NoneDicomStudy.SubjectVisitId == subjectVisitId).ProjectTo(_mapper.ConfigurationProvider, new { token = _userInfo.UserToken }).ToListAsync(); } - + [AllowAnonymous] [HttpGet] public async Task NoneDicomFilePreview(string relativePath) { @@ -225,19 +226,19 @@ namespace IRaCIS.Core.Application.Contracts var storePreviewPath = _fileStorePath + ".preview.jpeg"; - if (!File.Exists(storePreviewPath)) - { + //if (!File.Exists(storePreviewPath)) + //{ using (var image = SixLabors.ImageSharp.Image.Load(await File.ReadAllBytesAsync(_fileStorePath))) { image.Mutate(x => x - .Resize(image.Width / 2, image.Height / 2) + .Resize(400, 400) ); await image.SaveAsJpegAsync(storePreviewPath); } - } + //} return new FileContentResult(await File.ReadAllBytesAsync(storePreviewPath), "image/jpeg");