【问题标题】:Facebook do not use image link?Facebook不使用图片链接?
【发布时间】:2013-12-12 23:05:45
【问题描述】:

我的 ASP.NET MVC 网页上有一个如下所示的标题:

   <head>
            <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
            <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
            <meta name="HandheldFriendly" content="true">
            <meta charset="utf-8">
            <title>MyTitle</title>
            <meta content="Återanvänd på rätt vis" property="og:title">
            <meta content="website" property="og:type">
            <meta content="http://MyWebb.se/Post/Detail/392" property="og:url">
            <meta content="http://MyWebb.se/Content/Files/PostThumbnails/392.jpeg" property="og:image">
            <meta content="Some info" property="og:description">
            <meta content="MyWebb" property="og:site_name">
            <meta content="Återanvänd på rätt vis" name="twitter:title">
            <meta content="http://MyWebb.se/Post/Detail/392" name="twitter:url">
            <meta content="Some more info." name="twitter:description">
            <meta content="http://MyWebb.se/Content/Files/PostThumbnails/392.jpeg" name="twitter:image">
            <meta content="http://MyWebb.se/Content/Files/PostThumbnails/392.jpeg" name="description">
            <meta content="keywords" name="keywords">
            <link href="/favicon.ico?v=2" rel="shortcut icon" type="image/x-icon">
            <link href="/Content/Theme/MainTheme.css" rel="stylesheet" type="text/css">
            <meta name="viewport" content="width=device-width">        
    </head>

当使用这个工具检查它时:https://developers.facebook.com/tools/debug 它确实会获取图像。

但是当我将网址粘贴到墙贴时,它只会获取标题和描述,没有图像。如果拇指是方形的,图像加载就好了。

为什么“非方形”图像有效?我是否应该在我的所有拇指上生成空白空间(带有 png 的透明边框),以便它们获得方形格式?还是有其他解决方案?

也许是因为我缺少元数据的结束标记?但是那测试工具应该不会对数据进行细化吧?

【问题讨论】:

    标签: html css facebook facebook-opengraph meta


    【解决方案1】:

    问题是 og:image 的格式太小,修复后它工作得很好,没有说明大小。

    【讨论】:

      【解决方案2】:

      尝试按照 Facebook 开发者文档中的示例定义图像类型、宽度和高度 - https://developers.facebook.com/docs/web/tutorials/scrumptious/open-graph-object/

      <meta property="og:image" content="http://example.com/lamb-full.jpg">
      <meta property="og:image:type" content="image/jpeg">
      <meta property="og:image:width" content="3523">
      <meta property="og:image:height" content="2372">
      

      另请参阅此 SO 答案 - New og:image size for Facebook share? - 听起来图像有最小尺寸。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2010-11-07
        • 2013-02-16
        • 2016-11-26
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2013-11-08
        • 2014-01-04
        相关资源
        最近更新 更多