Note that there are some explanatory texts on larger screens.

plurals
  1. POFacebook Graph API Change: Picture type (size) no longer working?
    primarykey
    data
    text
    <p>According to Facebook's Graph API documentation (<a href="https://developers.facebook.com/docs/reference/api/" rel="noreferrer" title="here">here</a>), you can access various sizes of a user's profile picture through URLs such as:</p> <pre><code>https://graph.facebook.com/(userid)/picture?type=small https://graph.facebook.com/(userid)/picture?type=large </code></pre> <p>You'll notice that the first resolves to a url ending in _t.jpg (the small thumbnail) and the second ending in _n.jpg (the large image). So far so good. Equivalently, we should be able to query for these images like this:</p> <pre><code>https://graph.facebook.com/(userid)?fields=picture&amp;type=small https://graph.facebook.com/(userid)?fields=picture&amp;type=large </code></pre> <p>This latter format worked as expected for many months, until just a few days ago when it suddenly started ignoring the "type" parameter entirely - everything now resolves to an image ending in _q.jpg, which is the default if no "type" is specified. As a result, I can no longer figure out a way to query for the large image in PHP (my <em>real</em> problem). It used to work like this:</p> <pre><code>$pic = $facebook-&gt;api('/me', array('fields' =&gt; 'picture', 'type' =&gt; 'large')); </code></pre> <p>...but as described above, "type" has spontaneously started being ignored. I've spent several hours scouring their documentation but haven't been able to find any reference to what has changed, or the "new" way this should be done - any pointers would be hugely appreciated...</p> <p><strong>EDIT:</strong></p> <p>None of the following work, either (returns nothing):</p> <pre><code>$pic = $facebook-&gt;api('/me/picture', array('type' =&gt; 'large')); $pic = $facebook-&gt;api('/(my_uid)/picture', array('type' =&gt; 'large')); $pic = $facebook-&gt;api('/me/picture/?type=large'); $pic = $facebook-&gt;api('/(my_uid)/picture/?type=large'); </code></pre> <p>Basically, since Facebook broke things a few days ago there doesn't seem to be any way to get a non-default picture size from PHP. You can try out some of the calls yourself from the Graph API Explorer (<a href="https://developers.facebook.com/tools/explorer" rel="noreferrer" title="here">here</a>).</p> <p>Other related/relevant links:</p> <pre><code>http://stackoverflow.com/questions/2978761/facebook-graph-api-will-not-give-me-picture-data http://stackoverflow.com/questions/7718704/requesting-picture-for-event </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload