2

I am developing a Facebook game. In that the 10 opponent picture is displayed. I had saved these profile images in the database once the user had registered.

I am using PHP to echo the image, but the problem is some pictures are being displayed and others are giving me a ‘404’ / ‘400’ or ‘Invalid URL ‘ not found error. Example: ( These images earlier used to be displayed but not anymore)

http://sphotos-a.ak.fbcdn.net/hphotos-ak-ash3/522851_116822898455075_142765921_q.jpg
https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-snc6/199347_134645999940053_5814468_q.jpg.
  1. How can I fix this problem? Or find some alternative so that the broken link of these images is not displayed.
  2. I am having the user ID of these users, Can I somehow generate new picture if these picture links

    are detected as broken?

  3. Is it advisable to hotlink the Picture URLs ? I don't want this problem to occur again?

I would appreciate if some one could help me.

Yahoo
  • 4,093
  • 17
  • 59
  • 85

1 Answers1

0

You can use this url to fetch profile images of any user using his/her FB user id's

https://graph.facebook.com/<fb USER ID>/picture?type=large
Wasim
  • 896
  • 7
  • 24
  • Ah okay :) Then what exactly is the issue. I can make out this only from your question, assuming that you are storing image url in your db. As, if you store the whole image then you don't really need a fb url to display the images. – Wasim Dec 26 '12 at 15:35
  • http://stackoverflow.com/questions/1363925/check-whether-image-exists-on-remote-url ....... or do u have this issue – Wasim Dec 26 '12 at 15:56
  • @charsee- The link that you gave is a dynamic one. When you access this link you will be redirected to a link to a jpeg (it gets converted to a link that I gave above) I have saved these JPEG links in the Database. Earlier all of these links were working , but now some of them have stopped working. – Yahoo Dec 27 '12 at 15:09
  • I dodnt know why are they not working for all the images? May be facebook have changed the image location ( but in this case all running application should have faced this problem ). So I don't know what is wrong. – Yahoo Dec 27 '12 at 15:11