diff --git a/src/utils/images-optimization.ts b/src/utils/images-optimization.ts index 8eb75725ba..56662eaa42 100644 --- a/src/utils/images-optimization.ts +++ b/src/utils/images-optimization.ts @@ -225,12 +225,12 @@ export const astroAsseetsOptimizer: ImagesOptimizer = async ( return Promise.all( breakpoints.map(async (w: number) => { - const result = (await getImage({ src: image, width: w, inferSize: true, ...(format ? { format: format } : {}) })); + const result = await getImage({ src: image, width: w, inferSize: true, ...(format ? { format: format } : {}) }); return { src: result?.src, width: result?.attributes?.width ?? w, - height: result?.attributes?.height + height: result?.attributes?.height, }; }) ); diff --git a/src/utils/images.ts b/src/utils/images.ts index 1edd3961f0..f292f8899d 100644 --- a/src/utils/images.ts +++ b/src/utils/images.ts @@ -84,7 +84,9 @@ export const adaptOpenGraphImages = async ( typeof resolvedImage !== 'string' && resolvedImage?.width <= defaultWidth ? [resolvedImage?.width, resolvedImage?.height] : [defaultWidth, defaultHeight]; - _image = (await astroAsseetsOptimizer(resolvedImage, [dimensions[0]], dimensions[0], dimensions[1], 'jpg'))[0]; + _image = ( + await astroAsseetsOptimizer(resolvedImage, [dimensions[0]], dimensions[0], dimensions[1], 'jpg') + )[0]; } if (typeof _image === 'object') {