From 4cf46e0d8b8eceef6ed281ceab4a2df1c1c6bf8e Mon Sep 17 00:00:00 2001 From: Chet Husk Date: Wed, 8 May 2024 15:15:56 -0500 Subject: [PATCH] use writable dir --- src/custom-base-image/Program.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/custom-base-image/Program.cs b/src/custom-base-image/Program.cs index 7cf0252..de4477e 100644 --- a/src/custom-base-image/Program.cs +++ b/src/custom-base-image/Program.cs @@ -89,7 +89,9 @@ public static void Main(string[] args) // encode the image as a PNG var data = image.Encode(SKEncodedImageFormat.Png, 100); // save the PNG to disk - using (var stream = File.OpenWrite("output.png")) + var userHome = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile); + var outputPng = Path.Combine(userHome, "output.png"); + using (var stream = File.OpenWrite(outputPng)) { // copy the encoded image into the file stream data.SaveTo(stream);