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

Resized images don't have their proper URL in the ImageObject schema #19848

Open
mmikhan opened this issue Feb 10, 2023 · 0 comments · May be fixed by #21622
Open

Resized images don't have their proper URL in the ImageObject schema #19848

mmikhan opened this issue Feb 10, 2023 · 0 comments · May be fixed by #21622
Assignees
Labels
IM Yoast: Schema Yoast Feature

Comments

@mmikhan
Copy link
Member

mmikhan commented Feb 10, 2023

Reporter: @leonidasmi
From: https://yoast.atlassian.net/browse/IM-2115

The schema should describe the content that's on/in the page

According this master rule from @jonoalderson, we should add URLs in ImageObjects same to the ones we use in src of the images in the content. Currently, we’re not doing that always.

Steps to replicate the issue to be fixed:

  1. Create a post and upload an image in it. The post should have no feature image for the bug to have an effect (I think)
  2. Select a resized version of it via the image block (thumbnail, medium, large) and NOT use the full size image. For example, select the thumbnail.
  3. Visit the fronted

What we expect:

{
   "@type":"ImageObject",
   "@id":"https://example.com/test/#primaryimage",
   "url":"https://example.com/wp-content/uploads/2023/02/example-300x300.png",
   "contentUrl":"https://example.com/wp-content/uploads/2023/02/example-300x300.png",
   "width":300,
   "height":300
},

because the post will have a <img src="https://example.com/wp-content/uploads/2023/02/example-300x300.png"> image in its content

What we got instead:

{
   "@type":"ImageObject",
   "@id":"https://example.com/test/#primaryimage",
   "url":"https://example.com/wp-content/uploads/2023/02/example.png",
   "contentUrl":"https://example.com/wp-content/uploads/2023/02/example.png",
   "width":1500,
   "height": 1500
},

and that’s violates the The schema should describe the content that's on/in the page master rule.

Make sure to test the potential fix with images that are over 2900px, because WP is scaling down those and we need to make sure we fix those cases as well.

Thread for even more context: https://yoast.slack.com/archives/C03KU0EHCNQ/p1676019977503349

@mmikhan mmikhan added Yoast: Schema Yoast Feature IM labels Feb 10, 2023
@leonidasmi leonidasmi self-assigned this Sep 11, 2024
@leonidasmi leonidasmi linked a pull request Sep 12, 2024 that will close this issue
18 tasks
@leonidasmi leonidasmi removed their assignment Sep 13, 2024
@vraja-pro vraja-pro assigned vraja-pro and leonidasmi and unassigned vraja-pro Sep 13, 2024
@leonidasmi leonidasmi assigned vraja-pro and unassigned leonidasmi Sep 13, 2024
@thijsoo thijsoo assigned enricobattocchi and unassigned vraja-pro Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IM Yoast: Schema Yoast Feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants