来自facebook的高分辨率图像 [英] High Resolution Images from facebook

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

问题描述

这就是我从相册中获取相册和照片的方式。

This is how I am getting photo albums and pictures from the album.

let connectionPhotos = FBSDKGraphRequestConnection()
let requestPhotos = FBSDKGraphRequest(graphPath: String(format:"/%@/photos",albumID), parameters: ["fields":"picture.type(large)"], HTTPMethod: "GET")
connectionPhotos.addRequest(requestPhotos) { (connection:FBSDKGraphRequestConnection!, result:AnyObject!, error:NSError!) -> Void in
    if(error != nil){
        print(error)
        self.btnFacebook.userInteractionEnabled = true
        connectionPhotos.cancel()
    }else{
        connectionPhotos.cancel()
        self.arrImages = result["data"] as! Array<Dictionary<String, String>>

        if let userWSRequestKey = TRUserModel.SharedInstance()?.userWSRequestKey{
            if userWSRequestKey != X_API_DEFAULT_KEY{
                self.callSignInWS(dict)
            } else{
                JSONParser.sharedInstance.parseRequestKeyWithURL("", requestPrm: ["string":"string"], completionHandler: { (response) -> Void in
                    if response["status"] as! Int == 1 {
                        dispatch_async(dispatch_get_main_queue(), {() -> Void in
                            self.callSignInWS(dict)
                        })
                    } else {
                        dispatch_async(dispatch_get_main_queue(), {() -> Void in
                            self.showAlertView(INTERNET_PROBLEM)
                        })
                    }
                })
            }
        } else{
            JSONParser.sharedInstance.parseRequestKeyWithURL("", requestPrm: ["string":"string"], completionHandler: { (response) -> Void in
                if response["status"] as! Int == 1 {
                    dispatch_async(dispatch_get_main_queue(), {() -> Void in
                        self.callSignInWS(dict)
                    })
                } else {
                    dispatch_async(dispatch_get_main_queue(), {() -> Void in
                        self.showAlertView(INTERNET_PROBLEM)
                    })
                }
            })
        }
    }
}
connectionPhotos.start()




  • 简单地说,我有414 * 414像素大小的图像,我通过上面的代码得到的图像很小所以它会在我的应用程序中模糊。那么,我怎样才能获得大图像。

  • 任何建议?

  • 推荐答案

    使用此图表路径

    GET /v2.6/{photo-id}/?fields=images
    

    我正在获得不同大小的图像数组。

    i'm getting an array of images of different sizes.

    示例:

    {
    height:1365,
    来源:...,
    宽度:2048
    },
    {
    身高:960,
    来源 :...,
    宽度:1440
    },
    {
    身高:720,
    来源:...... ,
    宽度:1080
    }

    希望这会有所帮助:D

    hope this helped :D

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

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