Load image from 302 Redirect
in
Contributed Library Questions
•
2 years ago
So I have an array of Facebook IDs that I want to use to grab profile pictures from, so I have this loop set up:
- void draw (){
- int x=20;
- int y=20;
- for (int i=0; i < friends.length; i++) {
- FriendList friend = friends[i]; //returns the friend
- text(friend.name(),x+75/2,y+90 );
- String profilephoto = "https://graph.facebook.com/";
- profilephoto += friend.id + "/picture?type=large";
- PImage photo = requestImage(profilephoto, "jpg");
- image(photo, x+75/2,y+90);
- x+=85;
- if(x > width-85) {
- x=20;
- y+=105;
- }
- }
- }
However, I get this error ad infinitum:
The file
https://graph.facebook.com/[*removed facebook id*]/picture?type=large contains bad image data, or may not be an image.
Obviously it's not grabbing the image that it should be redirected to. Any tips for getting this to work?
1