Migrated from SixLabors to Magick.NET
This commit is contained in:
@@ -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; }
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user