From 70bb75e5a730d6d1d48f9ce3945eae51b9f854fc Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Wed, 22 Oct 2025 00:04:09 +0100 Subject: [PATCH 1/2] Update screenshot options to conditionally include quality for JPEG and WebP formats --- src/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 1eab1f9..3388eab 100644 --- a/src/index.js +++ b/src/index.js @@ -165,10 +165,14 @@ router.post( // Build screenshot options const screenshotOptions = { type: body.format, - quality: body.quality, fullPage: body.fullPage, }; + // Quality is only supported for JPEG and WebP formats + if (body.format === 'jpeg' || body.format === 'webp') { + screenshotOptions.quality = body.quality; + } + if (body.clip) { screenshotOptions.clip = body.clip; } From ec782161a6eff9546edc402872165231f4dd3604 Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Wed, 22 Oct 2025 22:58:02 +0100 Subject: [PATCH 2/2] Fixed formatting --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index f4a0ae9..b15b2fc 100644 --- a/src/index.js +++ b/src/index.js @@ -184,7 +184,7 @@ router.post( }; // Quality is only supported for JPEG and WebP formats - if (body.format === 'jpeg' || body.format === 'webp') { + if (body.format === "jpeg" || body.format === "webp") { screenshotOptions.quality = body.quality; }