Skip to content

Commit

Permalink
fix(gatsby-plugin-sharp): make sure to pass the failOnError option to…
Browse files Browse the repository at this point in the history
… base64 generation (#29254)

* make sure to pass the failOnError option to base64 generation

* Update packages/gatsby-plugin-sharp/src/index.js

Co-authored-by: Vladimir Razuvaev <vladimir.razuvaev@gmail.com>

Co-authored-by: Dominik Voss <dominik.voss@check24.de>
Co-authored-by: Vladimir Razuvaev <vladimir.razuvaev@gmail.com>
  • Loading branch information
3 people authored Jan 29, 2021
1 parent 3bf70cd commit bc0f5c8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/gatsby-plugin-sharp/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,9 @@ async function generateBase64({ file, args = {}, reporter }) {
})
let pipeline
try {
pipeline = sharp(file.absolutePath)
pipeline = !options.failOnError
? sharp(file.absolutePath, { failOnError: false })
: sharp(file.absolutePath)

if (!options.rotate) {
pipeline.rotate()
Expand Down

0 comments on commit bc0f5c8

Please sign in to comment.