Knowing if a Google Plus person has a real shot

I have an app that lists people in your circles using the Google+ API. This works well, except for one thing: the API does not say if the user has an image or if the picture is just a placeholder (blue silhouette).

https://developers.google.com/+/api/latest/people/list

{ "kind": "plus#person", "etag": etag, "id": string, "displayName": string, "image": { "url": string }, } 

How to determine if an image is a placeholder? (so I don't need to download it)

+4
source share
2 answers

Image URLs are displayed here:

 https://www.google.com/s2/photos/profile/{user_id} https://plus.google.com/s2/photos/profile/{user_id} https://profiles.google.com/s2/photos/profile/{user_id} 

Now 404 is better than loading the default image. I still love the API, just to tell us that the user did not set the image :(

+5
source

the answer will have isDefault: true for the placeholder image

 "image": { "url": "https://lh3.googleusercontent.com/.../photo.jpg?sz=50", "isDefault": true }, 
+3
source

Source: https://habr.com/ru/post/1486299/


All Articles