Fix print cropping and Linux custom photo path

This commit is contained in:
Natsumi
2025-02-17 13:17:43 +13:00
parent 8ee28ea3ca
commit 60d8d7682f
10 changed files with 44 additions and 26 deletions

View File

@@ -191,7 +191,8 @@ namespace VRCX
var ms = new MemoryStream(bytes);
var print = await Image.LoadAsync(ms);
// validation step to ensure image is actually a print
if (print.Width != 2048 || print.Height != 1440) return false;
if (print.Width != 2048 || print.Height != 1440)
return false;
var point = new Point(64, 69);
var size = new Size(1920, 1080);
@@ -199,14 +200,7 @@ namespace VRCX
print.Mutate(x => x.Crop(rectangle));
await print.SaveAsPngAsync(tempPath);
if (ScreenshotHelper.HasTXt(path))
{
var success = ScreenshotHelper.CopyTXt(path, tempPath);
if (!success)
{
File.Delete(tempPath);
return false;
}
}
ScreenshotHelper.CopyTXt(path, tempPath);
File.Move(tempPath, path, true);
return true;
}