Auth: Profile picture blurry

2,290 views
Skip to first unread message

Marcel Ulbrich

unread,
May 30, 2016, 11:00:04 AM5/30/16
to Firebase Google Group
I'm currently coding an Android app with FirebaseUI Auth and I'm wondering, what are the dimensions for profile pictures in Firebase and are there different URLs to retrieve hi-res and low-res versions.

Background:
In my app's welcome / tutorial activity, I use FirebaseUI Auth to let the user sign in (with Google only, currently).
After signing in, I retireve the user's name and profile picture and cast said picture on a 240dp CircularImageView with Glide.
On a Nexus 5, 240dp should be around 720px and despite my profile picture in G+ or on aboutme.google.com is of a much higher resolution, the picture in my app is blurry.

I built the same signin flow before with native Google+ signin and there were two different URLs for regular profile pictures and hi-res versions, but in the Firebase documentation I can't find anything like that.

So, 
- is there another URL than mFirebaseUser.getPhotoUrl() to get hi-res profile pictures?
- what is the resolution of profile pictures fetched from Firebase?
- does Firebase maybe fetch low-res pictures from G+?

Kato Richardson

unread,
May 31, 2016, 1:31:53 PM5/31/16
to Firebase Google Group
Hi Marcel,

As far as I can tell, the photos for Facebook, at least, are 50 x 50. Not sure about the others, but it sounds like you're getting similar results. 

I'm relatively certain we already have a feature request to make these more configurable (or at least bigger). I'll ping our auth experts and make sure your vote gets counted!

☼, Kato


--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/d8a579e9-2234-40a8-8d65-b9945df249cf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Kato Richardson | Developer Programs Eng | kato...@google.com | 775-235-8398

Alfonso Gomez Jordana Manas

unread,
May 31, 2016, 1:57:11 PM5/31/16
to Firebase Google Group
Hello Marcel,

We are thinking on how to best add this functionality on a future release. For now, these are the answers to your questions:

- is there another URL than mFirebaseUser.getPhotoUrl() to get hi-res profile pictures?

No.

- what is the resolution of profile pictures fetched from Firebase?

This varies by provider, but in general Firebase fetches the default image size that providers offer.

- does Firebase maybe fetch low-res pictures from G+?

Firebase currently fetches the default image size coming from the Google Sign In service, which is 96x96 px.

However, it is easy to change the resolution of the image with a very quick workaround using string substitutions.

Let's say this is the profile image URL of one of your users: 
Modify the 96 in the "s96-c" part to the number of pixels you would like the side of your image to be (they are always square AFAIK). For example  if you want a 400x400px image, then use the following url:



The workarounds for other providers are more complicated and may require requesting bigger sized images directly form the provider using an access token. Let me know if you are using any provider besides Google Sign-In and I can explain you the currently recommended solution.

Reply all
Reply to author
Forward
0 new messages