5
votes

url: https://graph.facebook.com/100779423975829/picture?type=large;

other url with type normal: https://graph.facebook.com/100779423975829/picture?type=normal


I tried to load url with Glide, Picasso, UniversalImageLoader and decodeStream from BitmapFactory and don't have any good result and the result is the next:

  • UniversalImageLoader: Image can't be decoded
  • BitmapFactory: bitmap = null

If I open the url with Chrome pc I will automatically download the photo without opening it.

in the webview from my app, i check the redirects from this url:

  1. https://lookaside.facebook.com/platform/profilepic/?asid=100779423975829&height=200&width=200

  2. https://m.facebook.com/platform/profilepic/?asid=100779423975829&height=200&width=200

Anyone else is having problems loading image profiles from Facebook graphs?

Thanks!

EDIT

The bug is resolved from Facebook. https://developers.facebook.com/bugs/261587761048160/

4

4 Answers

1
votes

Finally this was a facebook bug. So the problem is fixed by themselves.

https://developers.facebook.com/bugs/261587761048160/

0
votes

Yes, the redirections from http:// to https:// protocols hinders the downloading using Picasso,Glide ets. You may go ahead with following two approaches:

  1. SimpleDraweeView from Facebook Sdk. It handles the redirection internally.

  2. Make a graph request to fetch the re-directed url like below and use that url in picasso.

    new GraphRequest(AccessToken.getCurrentAccessToken(), "/"+fbUserId+"/picture?width="+width+"&height="+height+"&redirect=false", null, HttpMethod.GET, new GraphRequest.Callback() { public void onCompleted(GraphResponse response) {

                        try {
                            String url = response.getJSONObject().getJSONObject("data").getString("url");
                            loadFacebookProfilePicInImageView(url);
                        } catch (Exception e) {
                            e.printStackTrace();
                        }
    
                    }
                }
        ).executeAsync();
    
0
votes

I have the same issue. If you don't want to use the graph api for loading the public profile picture (as in my case) we both have a problem unless someone knows the solution.

0
votes

I have the same problem. It seems to be a bug. I think we are best of just waiting a day or two instead of putting the effort in fixing this ourselves. See also : Facebook graph user picture won't show on mobile devices and https://developers.facebook.com/bugs/560392384345729/