Daniel
Daniel

Reputation: 23359

Facebook graph profile image unreliable

I am trying to display a comments feed on my Facebook application, I am loading in an array of Facebook user ids and an associated comment, to display the users profile picture, I am using the following snippet:

<?php echo '<img src="http://graph.facebook.com/'.$c->_user.'/picture'" />; ?>

This works fine, and gets the image, however, if I refresh my page, I get some if not all of the thumbnails will not be loaded, refresh again and they'll always be there, it's pretty consistent that when I refresh they'll appear, next time they won't and so on.

Should I be dealing with this differently ? I know that in the browser the graph API redirects to the actual image, so maybe this is what's causing my browser to sometimes not display them, say if, it took too long to load the image ?

Upvotes: 2

Views: 802

Answers (2)

Jimmy Sawczuk
Jimmy Sawczuk

Reputation: 13614

The issue is probably what genesis φ says says, just a temporary issue on Facebook's end. But to add on to his suggestions, you might try serving the image from https:. Alternatively, you can get the full, redirect-less picture URL from the user FQL table.

Upvotes: 1

genesis
genesis

Reputation: 50976

It's probably just their temporary issue. If you want to be sure, download them for the first time and you could "host" them more reliabily

Upvotes: 1

Related Questions