Skip to content

Commit

Permalink
fix(gatsby-plugin-image): Apply defaults when width and height are set (
Browse files Browse the repository at this point in the history
  • Loading branch information
ascorbic committed Feb 24, 2021
1 parent 3db77a5 commit 3be9541
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/gatsby-plugin-image/src/image-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ export function setDefaultDimensions(
layout = camelCase(layout) as Layout

if (width && height) {
return args
return { ...args, formats, layout }
}
if (sourceMetadata.width && sourceMetadata.height && !aspectRatio) {
aspectRatio = sourceMetadata.width / sourceMetadata.height
Expand Down

0 comments on commit 3be9541

Please sign in to comment.