26 lines
526 B
C#
26 lines
526 B
C#
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"));
|
|
}
|
|
} |