File tree 2 files changed +7
-4
lines changed
packages/gatsby-plugin-sharp/src
2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -236,7 +236,9 @@ export async function generateImageData({
236
236
const primaryIndex =
237
237
layout === `fullWidth`
238
238
? imageSizes . sizes . length - 1 // The largest image
239
- : imageSizes . sizes . findIndex ( size => size === imageSizes . unscaledWidth )
239
+ : imageSizes . sizes . findIndex (
240
+ size => size === Math . round ( imageSizes . unscaledWidth )
241
+ )
240
242
241
243
if ( primaryIndex === - 1 ) {
242
244
reporter . error (
Original file line number Diff line number Diff line change @@ -119,9 +119,11 @@ exports.healOptions = (
119
119
// only set width to 400 if neither width nor height is passed
120
120
if ( options . width === undefined && options . height === undefined ) {
121
121
options . width = 400
122
- } else if ( options . width !== undefined ) {
122
+ }
123
+ if ( options . width !== undefined ) {
123
124
options . width = parseInt ( options . width , 10 )
124
- } else if ( options . height !== undefined ) {
125
+ }
126
+ if ( options . height !== undefined ) {
125
127
options . height = parseInt ( options . height , 10 )
126
128
}
127
129
@@ -141,7 +143,6 @@ exports.healOptions = (
141
143
)
142
144
}
143
145
} )
144
-
145
146
return options
146
147
}
147
148
You can’t perform that action at this time.
0 commit comments