Encode screenshot as JPEG when it has the extension (#2982)

This commit is contained in:
Dennis 2021-10-27 00:22:17 +02:00 committed by GitHub
parent c5a09f123b
commit 1e65515f63
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions

View File

@ -1193,8 +1193,15 @@ namespace BizHawk.Client.EmuHawk
using (var bb = Config.ScreenshotCaptureOsd ? CaptureOSD() : MakeScreenshotImage())
{
using var img = bb.ToSysdrawingBitmap();
if (Path.GetExtension(path).ToUpper() == ".JPG")
{
img.Save(fi.FullName, ImageFormat.Jpeg);
}
else
{
img.Save(fi.FullName, ImageFormat.Png);
}
}
AddOnScreenMessage($"{fi.Name} saved.");
}