Skip to content

Commit

Permalink
Guard quality option when using types that do not have quality sett…
Browse files Browse the repository at this point in the history
…ing (#118)
  • Loading branch information
cbbfcd authored Jan 29, 2024
1 parent 38682a2 commit c32ad08
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ const internalCaptureWebsiteCore = async (input, options, page, browser) => {
screenshotOptions.type = options.type;
}

if (options.quality) {
if (typeof options.quality === 'number' && options.type && options.type !== 'png') {
screenshotOptions.quality = options.quality * 100;
}

Expand Down

0 comments on commit c32ad08

Please sign in to comment.