wordpress-seo icon indicating copy to clipboard operation
wordpress-seo copied to clipboard

OG height and width are not output for small image

Open martijnvaneeghem opened this issue 8 years ago • 2 comments

  • [x] I've read and understood the contribution guidelines.
  • [x] I've searched for any related issues and avoided creating a duplicate issue.

Please give us a description of what happened.

I've tested https://github.com/Yoast/wordpress-seo/pull/9418.

I've uploaded a very small image file (6kb 300x200) as a Facebook image for a post via the social tab in the meta box, yet the height and width are not being outputted as og:height and og:width in the dom structure.

image-alignment-300x200

Please describe what you expected to happen and why.

I expected the og height and width tags to be displayed in the meta data.

How can we reproduce this behavior?

  1. Create new post and add facebook image via the social tab in the meta box
  2. Add the above image
  3. Check for the absence of the OG tags.

Technical info

  • WordPress version: 4.9.5
  • Yoast SEO version: 7.4 RC2
  • Relevant plugins in case of a bug: none
  • Tested with theme: Twenty Seventeen

martijnvaneeghem avatar Apr 25 '18 11:04 martijnvaneeghem

Cannot reproduce on the release/7.4 branch.

Tested this by uploading the image on the Facebook tab on a page and a post. In both cases this worked as expected.

If the image is added by using the exact URL of the provided image (https://user-images.githubusercontent.com/30408660/39243623-60d37798-488e-11e8-9f00-abe91dc04f5f.jpg), it will not add the width and height attributes, because images from URLs are not parsed for dimensions. This is intended behaviour.

moorscode avatar Apr 28 '18 17:04 moorscode

Investigated this further with @martijnvaneeghem and we came to the following conclusion:

Some of the test data he was using, was injected into his environment via a third-party script (what script this is, is unclear). This script seems to circumvent the usual media library uploading, resulting in the metadata not being calculated properly for that image. Therefor, this issue can be closed.

jcomack avatar Apr 30 '18 09:04 jcomack