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) (#29290)

* 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)

Co-authored-by: Dom <dominikvoss@mailbox.org>
  • Loading branch information
ascorbic and domvo committed Feb 1, 2021
1 parent 675dcfa commit c68b5e6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/gatsby-plugin-sharp/src/index.js
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 c68b5e6

Please sign in to comment.