28 lines
501 B
C#
28 lines
501 B
C#
|
|
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);
|
|
|
|
}
|
|
}
|
|
}
|
|
|