Migrated from SixLabors to Magick.NET

This commit is contained in:
Laurent
2026-02-17 19:38:16 +01:00
parent 423c74dcb8
commit 5132ec1c16
4 changed files with 29 additions and 21 deletions

View File

@@ -1,5 +1,5 @@
using System.IO;
using SixLabors.ImageSharp;
using ImageMagick;
namespace GifResizer.Models;
@@ -13,17 +13,16 @@ public class GifData
private void Load(string path)
{
ArgumentNullException.ThrowIfNull(path);
if (path.Length == 0 || path.IsWhiteSpace() || !File.Exists(path))
if (string.IsNullOrWhiteSpace(path) || !File.Exists(path))
throw new ArgumentException($"File '{path}' does not exist");
using Image image = Image.Load(path);
using var image = new MagickImage(path);
Path = path;
Width = image.Width;
Height = image.Height;
Width = (int)image.Width;
Height = (int)image.Height;
}
public string Path { get; private set; }
public int Width { get; private set; }
public int Height { get; private set; }
}