Facebook分享图片大小问题

时间:2013-11-13 03:05:23

标签: facebook image facebook-graph-api share

我正在努力解决Facebook图像尺寸问题,

当我在FB上共享图像时,它只采用了小尺寸(缩略图)。即使我共享一个高分辨率图像(1600x1200或900x400)所有尺寸的大小调整。

与以下代码共享。

<a class="btn" target="_blank" href="http://www.facebook.com/sharer.php?s=100&amp;p[title]=sample title&amp;p[summary]=custom summary&amp;p[url]=domainname&amp;p[images][0]=http://hidefwalls.com/wp-content/g/high-resolution/high-resolution-14-xooacj0rr2-1600x1200.jpg">share on facebook</a>

所以我的问题是有没有办法分享大图像尺寸(至少400x209)。 我跟随了很多links,但没有帮助我。

另请告诉我任何限制共享选项中显示的图片的选项。

提前致谢

1 个答案:

答案 0 :(得分:2)

我通过以下代码分享/发布。希望能帮助到你。 fbImg&amp;&amp; fbTxt是通过jquery从我的网站提取的动态图像

function publishWallPost() {
      var fbImg = $('.head .headerLeft p img')[0].src;
      var fbTxt = $('.head .headRight span.artistName').text();
      FB.ui({
          method: 'feed',
          name: 'Pandora - Which Star Are You',
          caption: 'https://www.facebook.com/pages/Pandora/119285608270259?id=119285608270259&sk=app_535647489852225',
          description: 'According to Pandora\'s Which Star Are You competition, I\'m ' + fbTxt + '. Click on the artist\'s picture to find out which star you are!',
          link: 'https://www.facebook.com/pages/Pandora/119285608270259?id=119285608270259&sk=app_535647489852225',
          picture: fbImg
        },
        function (response) {
          console.log('publishStory response: ', response);
        });
      return false;
}


window.fbAsyncInit = function () {
      FB.init({
        appId: '535647489852225',
        status: true,
        cookie: true,
        xfbml: true
      });
};

(function () {
      var e = document.createElement('script');
      e.async = true;
      e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
      document.getElementById('fb-root').appendChild(e);
}());