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

OpenGrap image (og:image) fetches wrong preset and isn't resized correctly #146

Closed
1 task done
putzwasser opened this issue Aug 15, 2020 · 0 comments · Fixed by #147
Closed
1 task done

OpenGrap image (og:image) fetches wrong preset and isn't resized correctly #146

putzwasser opened this issue Aug 15, 2020 · 0 comments · Fixed by #147
Assignees
Labels

Comments

@putzwasser
Copy link

This is a (multiple allowed):

  • bug

  • Version: Neos.Seo 3.1.0

What you did

Added an landscape orientated OpenGraph image to a document node.

Expected Behavior

Getting a <meta property="og:image" ...> tag with an image asset that has an aspect ratio of 1.91:1 and a max width of 1.200px and a max height of 627px.

Actual Behavior

The og:image tag gets rendered using always the Neos.Seo:OpenGraph.Square preset. Therefore the output is:

<meta property="og:image" content="mysite.local/_Resources/Persistent/4/4/e/e/44eebb9ba7358769a423325474ac3544999d3901/some-big-picture-4401x2309-1080x567.jpg">
<meta property="og:image:width" content="1080">
<meta property="og:image:height" content="567">

This limits the image width to 1080px. That's because this.image.isOrientationLandscape always returns null/false and therefore the Square preset is getting used.

Hotfix by @Sebobo

https://neos-project.slack.com/archives/C050C8FEK/p1597517105446300?thread_ts=1597495125.435700&cid=C050C8FEK

prototype(Neos.Seo:OpenGraphMetaTags) {
    preset = ${'Neos.Seo:OpenGraph.' + (this.image.orientation == 'landscape' ? 'Landscape' : 'Square')}
}
Sebobo added a commit to Sebobo/neos-seo that referenced this issue Aug 17, 2020
Before the orientation of the image was
not correctly checked as the `is…`
methods cannot be called from Fusion.

Resolves: neos#146
@Sebobo Sebobo self-assigned this Aug 17, 2020
@Sebobo Sebobo added the Bug label Aug 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants