-1

i want to get the full quality photo from GoogleSignInAccount (ANDROID STUDIO).

This is what i want URL = Photo1
This is what i get URL = Photo2

Does anyone know what I should do? // CODE

    GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
            .requestIdToken(getString(R.string.default_web_client_id))
            .requestEmail()
            .requestProfile()
            .build();

// i implement a class to Sign in with google, all works fine, but google gives a low quality photo in his url.

// IN MainActivity OnCreate ->

 googleSignInAccount = GoogleSignIn.getLastSignedInAccount(this);
    if(googleSignInAccount != null){
        String url = googleSignInAccount.getPhotoUrl();
    }

and then i receive the Photo2 but a want Photo1

IceCube
  • 3
  • 2

1 Answers1

0

You can replace the end scalling with other known scale (256, 512, 640, etc). In your case, you have a 96 scale

https://...Us2saWNwMUQ/s96-c/photo.jpg

You can make it bigger by replacing s96 with s1080 so you get

https://...Us2saWNwMUQ/s1080-c/photo.jpg

Cătălin Florescu
  • 5,012
  • 1
  • 25
  • 36