diff --git a/skullOS.Core/FileManager.cs b/skullOS.Core/FileManager.cs index f8ee37d..a330445 100644 --- a/skullOS.Core/FileManager.cs +++ b/skullOS.Core/FileManager.cs @@ -6,16 +6,24 @@ public static class FileManager { private static string rootDirectoryPath = string.Empty; - public static void CreateSkullDirectory() + public static void CreateSkullDirectory(bool usePersonalDir = true) { DirectoryInfo rootDirectory = null; - string pathToPersonalDir = @Environment.GetFolderPath(Environment.SpecialFolder.Personal); + string pathToDir; + if (usePersonalDir) + { + pathToDir = @Environment.GetFolderPath(Environment.SpecialFolder.Personal); + } + else + { + pathToDir = "/media"; + } try { if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) { - rootDirectory = Directory.CreateDirectory(@pathToPersonalDir + @"/skullOS", - unixCreateMode: UnixFileMode.UserRead | UnixFileMode.UserWrite | UnixFileMode.UserExecute); + rootDirectory = Directory.CreateDirectory(pathToDir + @"/skullOS", + unixCreateMode: UnixFileMode.OtherRead | UnixFileMode.OtherWrite | UnixFileMode.OtherExecute); } } catch (Exception e) diff --git a/skullOS.HardwareServices/CameraService.cs b/skullOS.HardwareServices/CameraService.cs index bd3a2aa..e3797da 100644 --- a/skullOS.HardwareServices/CameraService.cs +++ b/skullOS.HardwareServices/CameraService.cs @@ -31,6 +31,7 @@ public async Task TakePictureAsync(string fileLocation) .WithTimeout(1) .WithVflip() .WithHflip() + .WithPictureOptions(quality: 100) .WithResolution(2592, 1944); var args = builder.GetArguments(); @@ -39,8 +40,9 @@ public async Task TakePictureAsync(string fileLocation) Console.WriteLine(proc.GetFullCommandLine(args)); Console.WriteLine(); - //string? filename = $"{fileLocation} {DateTime.Now:yyyyMMddHHmmss}.jpg"; - string? filename = $"{DateTime.Now:yyyyMMddHHmmss}.jpg"; //Fakename + var timestamp = DateTime.Now.ToString("yyyyMMddHHmmss"); + string? filename = fileLocation + timestamp + ".jpg"; + //string? filename = $"{DateTime.Now:yyyyMMddHHmmss}.jpg"; //Fakename try { using var file = File.OpenWrite(filename); diff --git a/skullOS/Program.cs b/skullOS/Program.cs index 5269788..f712b9c 100644 --- a/skullOS/Program.cs +++ b/skullOS/Program.cs @@ -42,7 +42,7 @@ static void Run(bool shouldCreateDirectory = true) { if (shouldCreateDirectory) { - FileManager.CreateSkullDirectory(); + FileManager.CreateSkullDirectory(false); } SkullLogger logger = new();