Implemented gif exportation and added some style (again)
This commit is contained in:
26
GifResizer/Service/GifService.cs
Normal file
26
GifResizer/Service/GifService.cs
Normal 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"));
|
||||
}
|
||||
}
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user