fix override of the objectPosition property
This commit is contained in:
@@ -259,7 +259,7 @@ export const unpicOptimizer: ImagesOptimizer = async (image, breakpoints, width,
|
|||||||
/* ** */
|
/* ** */
|
||||||
export async function getImagesOptimized(
|
export async function getImagesOptimized(
|
||||||
image: ImageMetadata | string,
|
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([])
|
transform: ImagesOptimizer = () => Promise.resolve([])
|
||||||
): Promise<{ src: string; attributes: HTMLAttributes<'img'> }> {
|
): Promise<{ src: string; attributes: HTMLAttributes<'img'> }> {
|
||||||
if (typeof image !== 'string') {
|
if (typeof image !== 'string') {
|
||||||
@@ -315,6 +315,7 @@ export async function getImagesOptimized(
|
|||||||
width: width,
|
width: width,
|
||||||
height: height,
|
height: height,
|
||||||
aspectRatio: aspectRatio,
|
aspectRatio: aspectRatio,
|
||||||
|
objectPosition: objectPosition,
|
||||||
layout: layout,
|
layout: layout,
|
||||||
})}${style ?? ''}`,
|
})}${style ?? ''}`,
|
||||||
...rest,
|
...rest,
|
||||||
|
Reference in New Issue
Block a user