我们可以在 og:image 元标记中使用 webp 扩展图像吗?

Can we use webp extension image in og:image meta tag?

在我的网站上,我已将所有图像从 jpgpng 转换为 webp,但在此之后我的 og:image 元标记无法获取图像。在 facebook 调试器中,我看到以下错误

The provided 'og:image' properties are not yet available because new images are processed asynchronously. To ensure shares of new URLs include an image, specify the dimensions using 'og:image:width' and 'og:image:height' tags.

经过一番搜索后,我发现这个错误是在页面获取期间第一次出现,当时 facebook 有时无法在第一次获取图像尺寸,但在我的情况下,这个错误一直存在。是因为 facebook 可能无法获取图像详细信息,因为我使用了 webp 扩展程序。

https://developers.facebook.com/docs/sharing/webmasters/#images 说,

og:image:type - MIME type of the image. One of image/jpeg, image/gif or image/png

现在og:image:type不需要明确指定;但是由于 属性 提到了对那些 MIME / 文件类型的限制,这也意味着你 不能 将 WebP 用于 og:image.

Twitter and Facebook now supports WebP in og:meta.

它不在 OpenGraph 规范中 - 但仅在它的 Twitter 版本中 twitter:image。由于 Facebook 使用 og:image,因此可能还不支持 WebP

Hi, a comment without a source is not helping the community. – djibe Mar 22 at 9:26

推特:图片

A URL 到表示页面内容的唯一图像。您不应使用通用图像,例如您的网站徽标、作者照片或其他跨越多个页面的图像。此卡片的图像支持 2:1 的宽高比,最小尺寸为 300x157 或最大尺寸为 4096x4096 像素。图片的大小必须小于 5MB。支持 JPG、PNG、WEBP 和 GIF 格式。将仅使用动画 GIF 的第一帧。不支持 SVG。

https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/summary-card-with-large-image