簡體   English   中英

在Facebook圖形API中獲取child_attachments的全分辨率照片?

[英]Obtain full resolution photos for child_attachments in facebook graph api?

我想獲得每個子附件中返回的圖像的完整分辨率,但是我只得到一個圖像url。

這是我對Facebook圖形的調用:

$FB_graph_JSON = file_get_contents('https://graph.facebook.com/'.$FB_UserPageID.'/feed?limit=20&fields=from,full_picture,message,picture,child_attachments,object_id&'.$FB_fresh_token);

我可以獲取發布的完整圖片,但不能從子附件中獲取,子圖片的大小小於我的應用程序的理想大小。

有沒有辦法為孩子找回全分辨率圖像?

看一下子附件中的圖片值。 它們的格式如下:

https://external.xx.fbcdn.net/safe_image.php?d=xxx&url=http%3A%2F%2Fwww.example.com.tw%2Fsites%2Fdefault%2Fmy.jpg

URL參數正是您想要的。

您只需要提取url參數並對其執行URI組件解碼,即可獲得該孩子的完整分辨率圖像。

添加附件字段,並在[subattachments]節點中以全分辨率找到圖像

$FB_graph_JSON = file_get_contents('https://graph.facebook.com/'.$FB_UserPageID.'/feed?limit=20&fields=from,full_picture,message,picture,attachments,child_attachments,object_id&'.$FB_fresh_token);

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM