File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
packages/gatsby-plugin-sharp/src Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -84,9 +84,11 @@ function calculateImageDimensionsAndAspectRatio(file, options) {
8484
8585function prepareQueue ( { file, args } ) {
8686 const { pathPrefix, duotone, ...rest } = args
87- const options = Object . assign ( rest , duotone )
88- const argsDigestShort = createArgsDigest ( options )
89- const imgSrc = `/${ file . name } .${ options . toFormat } `
87+ // Duotone is a nested object inside transformOptions and has a [Object: Null Prototype]
88+ // So it's flattened into a new object so that createArgsDigest also takes duotone into account
89+ const digestArgs = Object . assign ( rest , duotone )
90+ const argsDigestShort = createArgsDigest ( digestArgs )
91+ const imgSrc = `/${ file . name } .${ args . toFormat } `
9092 const outputDir = path . join (
9193 process . cwd ( ) ,
9294 `public` ,
@@ -100,11 +102,11 @@ function prepareQueue({ file, args }) {
100102
101103 const { width, height, aspectRatio } = calculateImageDimensionsAndAspectRatio (
102104 file ,
103- options
105+ args
104106 )
105107
106108 // encode the file name for URL
107- const encodedImgSrc = `/${ encodeURIComponent ( file . name ) } .${ options . toFormat } `
109+ const encodedImgSrc = `/${ encodeURIComponent ( file . name ) } .${ args . toFormat } `
108110
109111 // Prefix the image src.
110112 const digestDirPrefix = `${ file . internal . contentDigest } /${ argsDigestShort } `
You can’t perform that action at this time.
0 commit comments