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>
(cherry picked from commit bc0f5c8)
  • Loading branch information
domvo authored and ascorbic committed Feb 1, 2021
1 parent 675dcfa commit 22ce5af
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 22ce5af

Please sign in to comment.