从Facebook API获取高分辨率图片 [英] Getting a High Resolution picture from Facebook API

查看:113
本文介绍了从Facebook API获取高分辨率图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Facebook的FFC API照片状态返回的照片的最大分辨率API为960x960:

Facebook FQL API for Photos states the maximum resolution for a photo returned from the API is 960x960:


Photo对象具有等效的src连接。使用photo_src
FQL,您可以检索具有以下维度的图像:960,720,
480,320,180,130,75像素。

The Photo object has an equivalent src connection. Using photo_src FQL, you can retrieve images with the following dimensions: 960, 720, 480, 320, 180, 130, 75 pixels.

但是,某些图像以更高的分辨率上传。有时甚至更高。

However, some images are uploaded at a higher resolution. Sometimes even much higher.

当定期浏览Facebook时,您可以看到这些照片并查看其全部尺寸。但是,我似乎无法找到任何方法来获得API中的原始解决方案。

When browsing Facebook regularly, you can see these pictures and view their full size. However, I can't seem to find any way to get the original resolution in the API.

这是可能的,我错过了什么吗?如果不是 - 为什么?

Is this possible and I have missed something? And if it's not - why?

推荐答案

获取图片的最大尺寸



Getting the max size of a picture

/USER_ID?fields=images

images 返回包含宽度,高度,源代码各种照片大小的对象数组。结果如下:

images gives back "an array of objects containing width, height, source each representing the various photo sizes". The result looks like this:

{
  "data": [
    {
      "images": [
        {
          "height": 1536, 
          "width": 2048, 
          "source": "https://fbcdn-sphotos-c-a.akamaihd.net/hphotos-ak-prn1/s2048x2048/65169_XXXXXX_n.jpg"
        }, 
        {
          "height": 720, 
          "width": 960, 
          "source": "https://fbcdn-sphotos-c-a.akamaihd.net/hphotos-ak-prn1/65169_44590146XXXXXXXXn.jpg"
        }, 
        {
          "height": 540, 
          "width": 720, 
          "source": "https://fbcdn-sphotos-c-a.akamaihd.net/hphotos-ak-prn1/s720x720/65169_44XXXXXXX0984540_n.jpg"
        },
        { 
          ...
        },
        {
          "height": 97, 
          "width": 130, 
          "source": "https://fbcdn-photos-a.akamaihd.net/hphotos-ak-prn1/s75x225/65169_44XXXXX_s.jpg"
        }
      ], 
    }
  ]
}



获取最终大小的个人资料图片



尝试超过960,即961.如果可以,您将获得图片的最大尺寸!

Getting the max size of a profile picture

Try with more than 960, i.e 961. You'll get the maximum size of the picture, if available!

/USER_ID?fields=picture.height(961)

结果:

{
  "id": "PROFILE_ID", 
  "picture": {
    "data": {
      "url": "https://fbcdn-profile-a.akamaihd.net/hprofile-ak-prn1/615962_4486XXXXXXXXX3_601495975_o.jpg", 
      "width": 1536, 
      "height": 2048, 
      "is_silhouette": false
    }
  }
}

这篇关于从Facebook API获取高分辨率图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆