Facebook无法掌握我的og:图像文件,我已经尝试了所有常见的解决方案。我开始认为这可能与https://..有关。

I have checked http://developers.facebook.com/tools/debug and have zero warnings or errors. It is finding the images we linked to in the "og:image", but they're showing up blank. When we click the image(s), however, they DO exist and it takes is straight to them. It DOES show one image -- an image hosted on a non-https server. We've tried square images, jpegs, pngs, larger sizes and smaller sizes. We've put the images right in public_html. Zero are showing up. It's not a caching error, because when we add another og:image to the meta, FB's linter does find and read that. It DOES show a preview. The preview is blank. The only exception we're getting is for images that are not on this website. We thought maybe there was some anti-leach on cpanel or the .htaccess that was preventing the images from showing up, so we checked. There was not. We even did a quick < img src="[remote file]" > on an entirely different server and the image shows up fine. We thought maybe it was the og:type or another oddity with another meta tag. We removed all of them, one at a time and checked it. No change. Just warnings. The same code on a different website shows up without any issue. We thought maybe it was not pulling images because we're using the same product page(s) for multiple products (changing it based on the get value, ie, "details.php?id=xxx") but it's still pulling in one image (from a different url). Leaving any og:image or image_src off, FB does not find any images.

我已经山穷水尽了。如果我说我自己和其他人在这方面花了多少时间,你会感到震惊。问题是这是一个在线商店。我们绝对绝对不能没有图像。我们必须这么做。我们还有十多个其他网站……这是唯一一个有og:图像问题的。它也是唯一一个使用https的,所以我们认为这可能是问题所在。但我们在网上找不到任何这样的先例。

这些是元标签:

<meta property="og:title" content="[The product name]" /> 
<meta property="og:description" content="[the product description]" /> 
<meta property="og:image" content="https://www.[ourwebsite].com/images/shirts/overdriven-blues-music-tshirt-details-black.png" />
<meta property="og:image" content="https://www.[ourwebsite].com/images/shirts/overdriven-blues-music-tshirt-art-black.png" />
<meta property="og:image" content="http://www.[ADIFFERENTwebsite].com/wp-content/uploads/2011/06/ARS-Header-Shine2.png" />
<meta property="og:image" content="https://www.[ourwebsite].com/images/ARShopHeader.png" />
<meta property="og:image" content="http://www.[ourwebsite].com/overdriven-blues-music-tshirt-art-black.JPG" />
<meta property="og:type" content="product"/>
<meta property="og:url" content="https://www.[ourwebsite].com/apparel-details.php?i=10047" />
<meta property="og:site_name" content="[our site name]" />      
<meta property="fb:admins" content="[FB-USER-ID-NUMBER]"/>
<meta name="title" content="[The product name]" />
<meta name="description" content="[The product description]" />
<link rel="image_src" href="https://www.[ourwebsite].com/images/shirts/overdriven-blues-music-tshirt-details-black.png" />
<meta name="keywords" content="[four typical keywords]">
<meta name="robots" content="noarchive">

如果你想要它,这里有一个链接到我们一直在做的产品页面。[缩短链接,试图阻止这进入我们网站的搜索结果]:http://rockn.ro/114

编辑——

使用“see what facebook sees”刮刀工具,我们可以看到以下内容:

"image": [          
      {
         "url": "https://www.[httpSwebsite].com/images/shirts/soul-man-soul-music-tshirt-details-safari.png"
      },
      {
         "url": "https://www.[httpSwebsite].com/images/shirts/soul-man-soul-music-tshirt-art-safari.png"
      },
      {
         "url": "http://www.[theotherNONSECUREwebsite].com/wp-content/uploads/2011/06/ARS-Header-Shine2.png"
      }
   ],

我们测试了它为单个页面找到的所有链接。所有这些都是完全有效的图像。

编辑2 ----

我们尝试了一个测试,并在NONSECURE网站上添加了一个子域名(从该网站上的图像实际上可以通过facebook看到)。子域名为http://img.[nonsecuresite].com。然后,我们将所有图像放入主子域文件夹并引用它们。它不会把这些图片拉进FB。但是,它仍然会提取在不安全的主域上引用的任何图像。

发布的解决方案----

Thanks to Keegan, we now know that this is a bug in Facebook. To workaround, we placed a subdomain in a different NON-HTTPS website and dumped all images in it. We referenced the coordinating http://img.otherdomain.com/[like-image.jpg] image in og:image on each product page. We then had to go through FB Linter and run EVERY link to refresh the OG data. This worked, but the solution is a band-aid workaround, and if the https issue is fixed and we go back to using the natural https domain, FB will have cached the images from a different website, complicating matters. Hopefully this information helps to save someone else from losing 32 coding hours of their life.


当前回答

我遇到了同样的问题,然后我注意到og:url的域不同

一旦我确定og:url和og:image的域是相同的,它就工作了。

希望这能有所帮助。

其他回答

对我来说,这很有效:

<meta property="og:url" content="http://yoursiteurl" />
    <meta property="og:image" content="link_to_first_image_if_you_want" />
    <meta property="og:image" content="link_to_second_image_if_you_want" />
    <meta property="og:image:type" content="image/jpeg" /> 
    <meta property="og:image:width" content="400" /> 
    <meta property="og:image:height" content="300" />
    <meta property="og:title" content="your title" />
    <meta property="og:description"  content="your text about homepage"/> 

我使用cloudfront分发指向s3桶来提供静态图像…我的云前端起源设置重定向HTTP到https…所以也许这和这事有关?

不管……

更新og:image从https到http解决了我的问题,图像现在被张贴到facebook的帖子与我的网站链接。

更新:上述行为继续发生…每当我要更改og:image url,或使我的cloudFront缓存失效时,图像将在FB调试器上工作,但图像永远不会显示在FB上。

我为我的og:image端点添加了一个新的行为,并将最小ttl、最大ttl和默认ttl设置为0。现在一切都很顺利……不理想,因为我更喜欢它被缓存,但显然FB不能处理cloudfront 304响应?

此外,当您添加用户生成的故事(不使用og:image)时,也会出现这个问题。例如:

POST /me/cookbook:eat?
  recipe=http://www.example.com/recipes/pizza/&
  image[0][url]=http://www.example.com/recipes/pizza/pizza.jpg&
  image[0][user_generated]=true&
  access_token=VALID_ACCESS_TOKEN

以上内容只适用于http,而不适用于https。如果你使用https,你会得到一个错误说: attach image()上传失败

我有一个Wordpress网站,使用og:image与一个https URL的图像和图像显示良好的Facebook预览链接。

我有另一个网站,我正在工作,使用og:image与https URL,有时图像会出现,有时他们不会。我尝试了这个页面上的建议,使用og:image:url和og:image:secure_url,两者都没有任何区别,图像不会用于预览。

这两个网站都有有效的https证书,所以不是证书问题。

在搜索了更多之后,我发现Facebook对图片有最小尺寸要求。如果og:image小于200x200px, Facebook将不会使用它。故事的推荐尺寸是600x600px,其他的推荐尺寸是1200x630px。

我在我的第二个网站上扩大了图片的大小,它们开始出现在Facebook上。神秘的解决。

希望这对你有用。

我发现了另一个可能导致此问题的场景。我完成了问题和答案中描述的所有步骤,但问题仍然存在。

我检查了我的图片,发现我的一些帖子在og:image中有太大的缩略图,在几千像素和几兆字节的范围内。

这是由于最近从WP迁移到Jekyll,我用gulp优化了我的图像,但错误地使用了og:image中的原始图像。

截至目前,Facebook为我们提供了以下建议:

使用至少1200 x 630像素的图像以获得最佳显示效果 高分辨率设备。至少,您应该使用 是600 x 315像素显示链接页面帖子与较大的图像。 图像的大小可达8MB。

所以有8MB的上限。