From eeffa5897d2f740032167fb115bf0faf65ecb652 Mon Sep 17 00:00:00 2001 From: ds5678 <49847914+ds5678@users.noreply.github.com> Date: Sun, 5 Oct 2025 22:44:07 -0700 Subject: [PATCH] Simplify path handling in the console app --- .../Program.cs | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/AssetRipper.TextureDecoder.ConsoleApp/Program.cs b/AssetRipper.TextureDecoder.ConsoleApp/Program.cs index 8d813fb..7a406dd 100644 --- a/AssetRipper.TextureDecoder.ConsoleApp/Program.cs +++ b/AssetRipper.TextureDecoder.ConsoleApp/Program.cs @@ -58,37 +58,34 @@ internal static partial class Program throw new NotSupportedException(inputType); } - string dirPath = Path.GetDirectoryName(path) ?? Environment.CurrentDirectory; - string name = Path.GetFileName(path); - switch (outputType) { case "bgra": - WriteAllBytes(Path.Combine(dirPath, name + ".bgra"), bitmap.Bits); + WriteAllBytes(path + ".bgra", bitmap.Bits); break; case "bmp": bitmap.FlipY(); - bitmap.SaveAsBmp(Path.Combine(dirPath, name + ".bmp")); + bitmap.SaveAsBmp(path + ".bmp"); break; case "exr": bitmap.FlipY(); - bitmap.SaveAsExr(Path.Combine(dirPath, name + ".exr")); + bitmap.SaveAsExr(path + ".exr"); break; case "hdr": bitmap.FlipY(); - bitmap.SaveAsHdr(Path.Combine(dirPath, name + ".hdr")); + bitmap.SaveAsHdr(path + ".hdr"); break; case "jpg": bitmap.FlipY(); - bitmap.SaveAsJpg(Path.Combine(dirPath, name + ".jpg")); + bitmap.SaveAsJpg(path + ".jpg"); break; case "png": bitmap.FlipY(); - bitmap.SaveAsPng(Path.Combine(dirPath, name + ".png")); + bitmap.SaveAsPng(path + ".png"); break; case "tga": bitmap.FlipY(); - bitmap.SaveAsTga(Path.Combine(dirPath, name + ".tga")); + bitmap.SaveAsTga(path + ".tga"); break; default: throw new NotSupportedException(outputType);