Skip to content

Blurred image not positioned correctly when using object-position #26309

@schoenwaldnils

Description

@schoenwaldnils

What version of Next.js are you using?

11.0.0

What version of Node.js are you using?

14.13.1

What browser are you using?

Chrome

What operating system are you using?

macOS

How are you deploying your application?

Vercel

Describe the Bug

Blurred images are not respecting the objectPosition property in Image component

Full image: Example Image

What I see:

Expected Behavior

The blurred placeholder should have the save position as the the later loaded full image.

What I expect:

An easy fix for this would be to mirror the object-position value to the background-position value while loading.

To Reproduce

Setup:

import Image from 'next/image'

import exampleImg from '../data/example.png'

const Page = () => (
  <Image
    src={exampleImg}
    width={1024}
    height={700}
    layout="responsive"
    objectFit="cover"
    objectPosition="center"
    placeholder="blur"
  />
)

export default Page

Deployed example: schoenwaldnils.vercel.app/objectPositionIssue

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions