Skip to content

Commit

Permalink
fix(gatsby-plugin-sharp): Include default transform options for webp (#…
Browse files Browse the repository at this point in the history
…28620)

* fix(gatsby-plugin-sharp): Include default transform options for webp

* SNapshots
  • Loading branch information
ascorbic authored Dec 15, 2020
1 parent 6e14292 commit 1c750b6
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 3 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 6 additions & 3 deletions packages/gatsby-plugin-sharp/src/image-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,10 @@ export async function generateImageData({
const width = Math.round(outputWidth)
const transform = createTransformObject({
quality,
...args.transformOptions,
...transformOptions,
fit,
cropFocus,
...args.webpOptions,
tracedSVGOptions,
width,
height: Math.round(width / imageSizes.aspectRatio),
toFormat: `webp`,
Expand Down Expand Up @@ -249,7 +250,9 @@ export async function generateImageData({
file,
args: {
...options,
...args.transformOptions,
...transformOptions,
fit,
cropFocus,
toFormatBase64: args.blurredOptions?.toFormat,
width: placeholderWidth,
height: Math.round(placeholderWidth / imageSizes.aspectRatio),
Expand Down

0 comments on commit 1c750b6

Please sign in to comment.