Skip to content

Commit 7f43c3b

Browse files
LekoArtsascorbic
andauthored
fix(gatsby-plugin-sharp): Include default transform options for webp (#28620) (#28629)
* fix(gatsby-plugin-sharp): Include default transform options for webp * SNapshots (cherry picked from commit 1c750b6) Co-authored-by: Matt Kane <[email protected]>
1 parent 5901a10 commit 7f43c3b

7 files changed

+6
-3
lines changed

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

+6-3
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)