From ad8fd187ea0e51a7ae9e0b46d85713f3dd445f28 Mon Sep 17 00:00:00 2001 From: Igor Klepacki Date: Wed, 6 Apr 2022 05:43:59 +0200 Subject: [PATCH] Fix error regarding unsupported quality option for webp and png --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index b2f42db..8717fa7 100644 --- a/src/index.ts +++ b/src/index.ts @@ -260,7 +260,7 @@ function createImageFactory({ const file = !isProductionLikeMode(envMode) && inspectHtml ? await page.content() - : await page.screenshot({ type, encoding: 'binary', quality }) + : await page.screenshot({ type, encoding: 'binary', ...(type === 'jpeg' ? { quality } : null) }) return file }, }