Use real temp dir instead of cache dir for temp files (#12226)

This commit is contained in:
Bond-009
2024-07-15 14:44:14 +02:00
committed by GitHub
parent 5e840c1db6
commit c666f9d050
10 changed files with 22 additions and 22 deletions

View File

@@ -219,7 +219,7 @@ public class SkiaEncoder : IImageEncoder
return path;
}
var tempPath = Path.Combine(_appPaths.TempDirectory, string.Concat(Guid.NewGuid().ToString(), Path.GetExtension(path.AsSpan())));
var tempPath = Path.Join(_appPaths.TempDirectory, string.Concat("skia_", Guid.NewGuid().ToString(), Path.GetExtension(path.AsSpan())));
var directory = Path.GetDirectoryName(tempPath) ?? throw new ResourceNotFoundException($"Provided path ({tempPath}) is not valid.");
Directory.CreateDirectory(directory);
File.Copy(path, tempPath, true);