Skip to content

Commit 1e65515

Browse files
authored
Encode screenshot as JPEG when it has the extension (#2982)
1 parent c5a09f1 commit 1e65515

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/BizHawk.Client.EmuHawk/MainForm.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1193,7 +1193,14 @@ public void TakeScreenshot(string path)
11931193
using (var bb = Config.ScreenshotCaptureOsd ? CaptureOSD() : MakeScreenshotImage())
11941194
{
11951195
using var img = bb.ToSysdrawingBitmap();
1196-
img.Save(fi.FullName, ImageFormat.Png);
1196+
if (Path.GetExtension(path).ToUpper() == ".JPG")
1197+
{
1198+
img.Save(fi.FullName, ImageFormat.Jpeg);
1199+
}
1200+
else
1201+
{
1202+
img.Save(fi.FullName, ImageFormat.Png);
1203+
}
11971204
}
11981205

11991206
AddOnScreenMessage($"{fi.Name} saved.");

0 commit comments

Comments
 (0)