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

(cherry picked from commit 1c750b6)
  • Loading branch information
ascorbic authored and LekoArts committed Dec 15, 2020
1 parent 15cf4a2 commit 97e0250
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 97e0250

Please sign in to comment.