Skip to content

Commit

Permalink
fix override of the objectPosition property
Browse files Browse the repository at this point in the history
  • Loading branch information
ejulia authored Sep 28, 2024
1 parent 6fde4b0 commit 0924374
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/utils/images-optimization.ts
Original file line number Diff line number Diff line change
@@ -259,7 +259,7 @@ export const unpicOptimizer: ImagesOptimizer = async (image, breakpoints, width,
/* ** */
export async function getImagesOptimized(
image: ImageMetadata | string,
{ src: _, width, height, sizes, aspectRatio, widths, layout = 'constrained', style = '', ...rest }: ImageProps,
{ src: _, width, height, sizes, aspectRatio, objectPosition, widths, layout = 'constrained', style = '', ...rest }: ImageProps,
transform: ImagesOptimizer = () => Promise.resolve([])
): Promise<{ src: string; attributes: HTMLAttributes<'img'> }> {
if (typeof image !== 'string') {
@@ -315,6 +315,7 @@ export async function getImagesOptimized(
width: width,
height: height,
aspectRatio: aspectRatio,
objectPosition: objectPosition,
layout: layout,
})}${style ?? ''}`,
...rest,

0 comments on commit 0924374

Please sign in to comment.