Skip to content

Commit c68b5e6

Browse files
ascorbicdomvo
andauthored
fix(gatsby-plugin-sharp): make sure to pass the failOnError option to 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 <[email protected]> Co-authored-by: Dominik Voss <[email protected]> Co-authored-by: Vladimir Razuvaev <[email protected]> (cherry picked from commit bc0f5c8) Co-authored-by: Dom <[email protected]>
1 parent 675dcfa commit c68b5e6

File tree

1 file changed

+3
-1
lines changed
  • packages/gatsby-plugin-sharp/src

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,9 @@ async function generateBase64({ file, args = {}, reporter }) {
274274
})
275275
let pipeline
276276
try {
277-
pipeline = sharp(file.absolutePath)
277+
pipeline = !options.failOnError
278+
? sharp(file.absolutePath, { failOnError: false })
279+
: sharp(file.absolutePath)
278280

279281
if (!options.rotate) {
280282
pipeline.rotate()

0 commit comments

Comments
 (0)