Updated output location

This commit is contained in:
Laurent
2026-02-17 18:31:42 +01:00
parent 4a5bf8dfff
commit 423c74dcb8
2 changed files with 10 additions and 6 deletions

View File

@@ -1,11 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
<TargetFramework>net10.0-windows</TargetFramework> <TargetFramework>net10.0-windows</TargetFramework>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<UseWPF>true</UseWPF> <UseWPF>true</UseWPF>
<SelfContained>true</SelfContained>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

View File

@@ -18,9 +18,11 @@ public class GifService
public void ResizeGif(string filePath, int width, int height) public void ResizeGif(string filePath, int width, int height)
{ {
string downloadsFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "Downloads");
string fileName = Path.GetFileNameWithoutExtension(filePath);
using Gif gif = new Gif(filePath); using Gif gif = new Gif(filePath);
gif.Load(); gif.Load();
gif.Resize(width, height); gif.Resize(width, height);
gif.Save(Path.Combine(Directory.GetCurrentDirectory(), "output", $"{width}x{height}.gif")); gif.Save(Path.Combine(downloadsFolder, "gif-resizer", fileName, $"{fileName}-{width}x{height}.gif"));
} }
} }