We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 05eb934 commit e11c970Copy full SHA for e11c970
packages/gatsby-plugin-sharp/src/index.js
@@ -30,6 +30,14 @@ const getImageSize = file => {
30
const dimensions = imageSize.sync(
31
toArray(fs.readFileSync(file.absolutePath))
32
)
33
+
34
+ if (!dimensions) {
35
+ reportError(
36
+ `gatsby-plugin-sharp couldn't determine dimensions for file:\n${file.absolutePath}\nThis file is unusable and is most likely corrupt.`,
37
+ ``
38
+ )
39
+ }
40
41
imageSizeCache.set(file.internal.contentDigest, dimensions)
42
return dimensions
43
}
0 commit comments