Skip to content

Commit 9b1a597

Browse files
rgelbkblok
authored andcommitted
Provide default quality for jpeg screenshots (#922)
1 parent 3683608 commit 9b1a597

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/PuppeteerSharp/Page.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -967,6 +967,11 @@ public async Task ScreenshotAsync(string file, ScreenshotOptions options)
967967
if (!options.Type.HasValue)
968968
{
969969
options.Type = ScreenshotOptions.GetScreenshotTypeFromFile(file);
970+
971+
if (options.Type == ScreenshotType.Jpeg && !options.Quality.HasValue)
972+
{
973+
options.Quality = 90;
974+
}
970975
}
971976
var data = await ScreenshotDataAsync(options).ConfigureAwait(false);
972977

0 commit comments

Comments
 (0)