From 7593d89b6bc971b78f6f6272fa14594cc5fe584a Mon Sep 17 00:00:00 2001 From: Jamie Barton Date: Tue, 30 Mar 2021 13:46:04 +0100 Subject: [PATCH] fix: return null for non images (#184) * fix: dont return null for gatsby image data * fix: return null for unless image mimeType --- gatsby-source-graphcms/src/gatsby-node.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gatsby-source-graphcms/src/gatsby-node.js b/gatsby-source-graphcms/src/gatsby-node.js index 6b47c32..26b3cfc 100644 --- a/gatsby-source-graphcms/src/gatsby-node.js +++ b/gatsby-source-graphcms/src/gatsby-node.js @@ -348,7 +348,9 @@ function makeResolveGatsbyImageData(cache) { { handle: filename, height, mimeType, width, url, internal }, options ) { - if (!mimeType.includes('image/')) { + if ( + !['image/png', 'image/jpg', 'image/jpeg', 'image/tiff'].includes(mimeType) + ) { return null }