Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FEATURE: Add image helper and render image dimensions in image tag attributes #5131

Open
wants to merge 1 commit into
base: 8.4
Choose a base branch
from

Conversation

Sebobo
Copy link
Member

@Sebobo Sebobo commented Jun 5, 2024

With this change a new image helper is introduced in Neos.Media which allows creating a thumbnail and using its various properties in Fusion object. This way the actual size of a thumbnail can be rendered into the HTML attributes.
Until now we only had the uri from the ImageUri helper and component.

Review instructions

Adjust the image prototype renderer in the Demo like this:

prototype(Neos.Demo:Content.Image) < prototype(Neos.Neos:ContentComponent) {
    renderer = afx`
        <figure>
            <Neos.Neos:ImageTag
                asset={q(node).property('image')}
                width={900}
                height={200}
                allowUpScaling={true}
            />
        </figure>
    `
//    renderer = afx`<Neos.Demo:Presentation.Image {...props} />`
}

The resulting image should have with and height properties of the generated thumbnail and not the ones of the original.

I'm not 100% sure if we could break something with this change if somebody modified the ImageTag prototype.
We can also target 9.0 if the anybody thinks this would be better.

With this change a new image helper is introduced in Neos.Media
which allows creating a thumbnail and using its various properties
in Fusion object. This way the actual size of a thumbnail can be rendered into
the HTML attributes.
Until now we only had the uri from the ImageUri helper and component.
Copy link
Member

@crydotsnake crydotsnake left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codewise and functionality wise its working great for me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants