From 49a27ae981f85f6b099203298157beb3a2ecb993 Mon Sep 17 00:00:00 2001 From: Max Gripe <108034506+MaxGripe@users.noreply.github.com> Date: Fri, 20 Sep 2024 14:06:19 +0200 Subject: [PATCH] Update Program.fs --- Program.fs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Program.fs b/Program.fs index 2bffc94..6127521 100644 --- a/Program.fs +++ b/Program.fs @@ -56,9 +56,10 @@ let addWhiteBorderAndReplace (inputFile: string) = image.Dispose() - let tempFile = Path.GetTempFileName() - saveImage newImage tempFile format - File.Replace(tempFile, inputFile, null) + let tempFileName = Path.GetRandomFileName() + let tempFilePath = Path.Combine(Path.GetDirectoryName(inputFile), tempFileName) + saveImage newImage tempFilePath format + File.Replace(tempFilePath, inputFile, null)