【问题标题】:Facebook og:image is there a way to force the small image when using a larger image?Facebook og:image 有没有办法在使用大图像时强制使用小图像?
【发布时间】:2021-10-19 11:00:21
【问题描述】:

当使用 og:image og:image:width 和 og:image:height 标签时,有没有办法在不发送较小图像的情况下强制小方块?似乎这一切都取决于图像大小,但我不想仅仅为了这种特殊情况为我们所有的客户创建小图像。

示例 og 标签

<meta property="og:site_name" content="Website" />
<meta property="og:url" content="https://update-meta-og-image-size.website.com/26" />
<meta property="og:title" content="Bryan's Test Podcast" />
<meta property="og:description" content="test" />
<meta property="og:type" content="website" />
<meta property="og:image" content="https://update-meta-og-image-size.website.com/rails/active_storage/representations/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBaFlOIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--7d72c666e0629761997a934a6e85768855d51a78/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdDem9MWm05eWJXRjBTU0lKYW5CbFp3WTZCa1ZVT2d0eVpYTnBlbVZKSWcwMk1EQjROakF3WGdZN0JsUTZER2R5WVhacGRIbEpJZ3RqWlc1MFpYSUdPd1pVT2d0bGVIUmxiblJKSWd3Mk1EQjROakF3QmpzR1ZEb01jWFZoYkdsMGVXbFZPZzlqYjJ4dmNuTndZV05sU1NJSmMxSkhRZ1k3QmxRPSIsImV4cCI6bnVsbCwicHVyIjoidmFyaWF0aW9uIn19--25250704e399b7eace9a4c2dfeb0ef445eea7c20/canva-design.jpeg" />
<meta property="og:image:width" content="250" />
<meta property="og:image:height" content="250" />
<meta property="fb:app_id" content="1234567890" />

更大的分享不正确

即使图像大于 250x250,我也想显示正确的图像尺寸。我想使用 600x600。

【问题讨论】:

    标签: facebook facebook-opengraph facebook-sharer og-meta


    【解决方案1】:

    og:image:widthog:image:height 标签不用于指定图像在预览中显示的大小。卡片显示完全取决于您分享链接的平台。

    Facebook's documentation:

    使用这些标签将为爬虫指定图像尺寸,以便它可以立即渲染图像,而无需异步下载和处理。

    这只是告诉爬虫尺寸是多少,以便预览渲染得更快。它对预览中图像的实际大小没有影响。

    如果您希望预览显示较小的图像,则必须提供具有相应尺寸的图像。

    【讨论】:

      猜你喜欢
      • 2012-10-19
      • 2010-10-27
      • 2015-05-16
      • 2012-08-02
      • 2014-06-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多