Skip to content

Commit

Permalink
Fix error regarding unsupported quality option for webp and png
Browse files Browse the repository at this point in the history
  • Loading branch information
neg4n committed Apr 6, 2022
1 parent b9a4e84 commit ad8fd18
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
},
}
Expand Down

0 comments on commit ad8fd18

Please sign in to comment.