4
votes

I am using Google Plus as a login, capturing users information etc.

The profile picture I am saving looks like the following :

https://lh4.googleusercontent.com/-ahWlp0z8KQM/AAAAAAAAAAI/AAAAAAAAAGA/nEfC5WjfVM4/photo.jpg

I am trying to get the various sizes e.g. small and large.

Is there some way I can just add an URL variable like ?size=small or just a change in URL?? Is there any way?

2

2 Answers

15
votes

You can also pass the sz query parameter to resize the image.

Passing ?sz=10 will resize the original image to a 10x10 image.

https://lh4.googleusercontent.com/-ahWlp0z8KQM/AAAAAAAAAAI/AAAAAAAAAGA/nEfC5WjfVM4/photo.jpg?sz=10
6
votes

You can specify the image size in the URL but it isn't a querystring parameter.

This is a link to a nice photo of moi:

https://lh6.googleusercontent.com/-CsrOQxw0XqI/AAAAAAAAAAI/AAAAAAAAAGA/l87kTXQIMnQ/s230-c-k/photo.jpg

Notice the piece preceeding the photo name: /s230-c-k/

The number 230 reprisents the size of the image being retrived. Changing this will return an image with a width of that value for you.

In your case, something like:

https://lh4.googleusercontent.com/-ahWlp0z8KQM/AAAAAAAAAAI/AAAAAAAAAGA/nEfC5WjfVM4/s210-c-k/photo.jpg