场景:我正在开发一个应用程序,我需要通过该应用程序从 Facebook 下载用户的个人资料图片,应用特定的过滤器,然后重新上传并将其设置为个人资料图片,这可以使用这个技巧。' makeprofile=1 '
http://www.facebook.com/photo.php?pid=xyz&id=abc&makeprofile=1
问题: 所以我面临的问题是通过 API 从接收到的 URL 下载图片时。我通过这种方式获取图片 URL:
$request = $this->fb->get('/me/picture?redirect=false&width=9999',$accessToken); // 9999 width for the desired size image
// return object as in array form
$pic = $request->getGraphObject()->asArray();
// Get the exact url
$pic = $pic['url'];
现在我想将获得的 URL 中的图像保存到我服务器上的目录中,以便我可以应用过滤器并重新上传它。当我使用file_get_contents($pic)时,它会引发以下错误
file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed
我也尝试了其他一些方法,但无法解决这个问题。任何帮助,将不胜感激 :)
注意:我现在通过 Codeigniter 和 localhost 执行此操作。