Skip to content

Commit 70bb75e

Browse files
committed
Update screenshot options to conditionally include quality for JPEG and WebP formats
1 parent 3030854 commit 70bb75e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,14 @@ router.post(
165165
// Build screenshot options
166166
const screenshotOptions = {
167167
type: body.format,
168-
quality: body.quality,
169168
fullPage: body.fullPage,
170169
};
171170

171+
// Quality is only supported for JPEG and WebP formats
172+
if (body.format === 'jpeg' || body.format === 'webp') {
173+
screenshotOptions.quality = body.quality;
174+
}
175+
172176
if (body.clip) {
173177
screenshotOptions.clip = body.clip;
174178
}

0 commit comments

Comments
 (0)