diff --git a/src/index.js b/src/index.js index eb43180..b15b2fc 100644 --- a/src/index.js +++ b/src/index.js @@ -180,10 +180,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; }