缩略图测试

This commit is contained in:
2022-05-20 10:14:01 +08:00
parent 04a24ea438
commit ca1f23ca4d
7 changed files with 144 additions and 42 deletions
@@ -0,0 +1,27 @@
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.Processing;
namespace IRaCIS.Core.Application.Helper;
public static class ImageResizeHelper
{
public static void ResizeSave(string filePath, string? fileStorePath)
{
fileStorePath = fileStorePath ?? filePath + ".preview.jpeg";
using (var image = SixLabors.ImageSharp.Image.Load(filePath))
{
image.Mutate(x => x.Resize(500, 500));
image.Save(fileStorePath);
}
}
}