Implemented gif exportation and added some style (again)

This commit is contained in:
Laurent
2026-02-17 18:20:53 +01:00
parent b81d912cf4
commit 4a5bf8dfff
10 changed files with 268 additions and 101 deletions

View File

@@ -0,0 +1,26 @@
using System.IO;
using GifResizer.Models;
namespace GifResizer.Service;
public class GifService
{
public GifService()
{
}
public GifData GetData(string filePath)
{
return new GifData(filePath);
}
public void ResizeGif(string filePath, int width, int height)
{
using Gif gif = new Gif(filePath);
gif.Load();
gif.Resize(width, height);
gif.Save(Path.Combine(Directory.GetCurrentDirectory(), "output", $"{width}x{height}.gif"));
}
}

View File

@@ -1,20 +0,0 @@
using GifResizer.Models;
namespace GifResizer.Service;
public class ResizeService
{
public ResizeService()
{
}
public void ResizeGif(string filePath, int width, int height)
{
using Gif gif = new Gif(filePath);
gif.Load();
gif.Resize(width, height);
gif.Save("D:/test-output.gif");
}
}