Facebook linter reports og:image is too small, when it is larger than the image it choose instead

喜你入骨 提交于 2019-12-07 04:47:16

问题


Problem:

  • linter reports that specified og:image is too small. Image is 628x464.
  • linter instead picks a random image from the page which is 380x214, smaller than the og:image!

What the linter shows me:

http://developers.facebook.com/tools/debug/og/object?q=futuremark.com

Background:

We have been happily using 130x110 og:images without problems for the last 9 months. I noticed in the last couple of weeks that pages were no longer sharing the correct image. Using the linter it seems that Facebook recently decided og:images should be at least 200x200. So I have been replacing our og:images with larger examples but the linter still says they are too small.

Any ideas how I can fix this, or is it a Facebook problem? Thanks.


回答1:


Now I guess that Facebook does not find tags for height and width and considers them null. In my case, next tags fixed this issue:

<meta property="og:image:type" content="image/jpeg" />
<meta property="og:image:width" content="1280" />
<meta property="og:image:height" content="855" />



回答2:


Did you change how big the image file at http://www.futuremark.com/images/facebook/futuremark-logo.png is without changing the URL specified in the og:image meta tag?

The image itself will be cached if the URL didn't change, so you need to change the URL (or add a cash-busting parameter like ?v=1 to the end)




回答3:


I ran into this same issue, for me the problem was with the URL defined in the og:image not matching the URL being checked

for example my og:image tag had

<meta property="og:image" content="http://www.soundfuse.co.uk/public/images/logo_300px.png"/>

And the URL I was actually checking against was

http://soundfuse.co.uk

Notice the missing www. on the TLD? This caused a 301 redirect to occur from soundfuse.co.uk to www.soundfuse.co.uk, but once I matched both primary URL's up it worked as expected.




回答4:


This issue is also triggered if you're enforcing no trailing slashes with .htaccess [301]. Facebook infers this slash if no og:url is present.




回答5:


There is a useful workaround for this issue. If you use a URL shortener to create a new URL, the image seems to load without error.

For example, paste your Youtube URL into bitly.com's URL shortener, then paste the shortened URL into Facebook. The thumbnail image will then be displayed as intended.



来源:https://stackoverflow.com/questions/15004288/facebook-linter-reports-ogimage-is-too-small-when-it-is-larger-than-the-image

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!