Skip to content

Commit 1c750b6

Browse files
authored
fix(gatsby-plugin-sharp): Include default transform options for webp (#28620)
* fix(gatsby-plugin-sharp): Include default transform options for webp * SNapshots
1 parent 6e14292 commit 1c750b6

7 files changed

+6
-3
lines changed

packages/gatsby-plugin-sharp/src/image-data.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,9 +218,10 @@ export async function generateImageData({
218218
const width = Math.round(outputWidth)
219219
const transform = createTransformObject({
220220
quality,
221-
...args.transformOptions,
221+
...transformOptions,
222+
fit,
223+
cropFocus,
222224
...args.webpOptions,
223-
tracedSVGOptions,
224225
width,
225226
height: Math.round(width / imageSizes.aspectRatio),
226227
toFormat: `webp`,
@@ -249,7 +250,9 @@ export async function generateImageData({
249250
file,
250251
args: {
251252
...options,
252-
...args.transformOptions,
253+
...transformOptions,
254+
fit,
255+
cropFocus,
253256
toFormatBase64: args.blurredOptions?.toFormat,
254257
width: placeholderWidth,
255258
height: Math.round(placeholderWidth / imageSizes.aspectRatio),

0 commit comments

Comments
 (0)