From 73d4c0219122f207ed443166166b1fa58cc58247 Mon Sep 17 00:00:00 2001 From: Meizar Rimadana Date: Fri, 1 Aug 2025 08:36:27 +0700 Subject: [PATCH] fix path --- WebApp/Coordinate.cs | 10 +++++++++- WebApp/ImageGenerator.cs | 4 ++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/WebApp/Coordinate.cs b/WebApp/Coordinate.cs index 0b94bee..9985937 100644 --- a/WebApp/Coordinate.cs +++ b/WebApp/Coordinate.cs @@ -6,7 +6,15 @@ internal record Coordinate public string Name { get; } public int Row { get; } public int Col { get; } - public string Path => BasePath + Name + ".png"; + + public string FullPath + { + get + { + string filename = Name + ".png"; + return Path.Combine(BasePath, filename); + } + } public Coordinate(string name) { diff --git a/WebApp/ImageGenerator.cs b/WebApp/ImageGenerator.cs index a482e59..711beb8 100644 --- a/WebApp/ImageGenerator.cs +++ b/WebApp/ImageGenerator.cs @@ -9,7 +9,7 @@ public class ImageGenerator string[] inputs = requestBody.CanvasRect.Split(":"); double scale = requestBody.OutputScale; Coordinate a1 = new Coordinate("A1"); - Mat a1Mat = new Mat(a1.Path); + Mat a1Mat = new Mat(a1.FullPath); int width = a1Mat.Width; int height = a1Mat.Height; if (scale < 1) @@ -36,7 +36,7 @@ public class ImageGenerator { try { - Mat mat = new Mat(item.Path); + Mat mat = new Mat(item.FullPath); if (scale < 1) { mat = mat.Resize(new Size(width, height));