zquestz/omniauth-google-oauth2 — pull request #60 by GuilhermeSimoes (2013-06-18 13:38:15+00:00)
Title: Added options to change the dimensions of the user's profile picture

Ok, so this feature isn't documented **anywhere** but since Google+ makes extensive use of it so that every image perfectly fits its stream layout, my feeling is that it's not going to disappear overnight. Still, since this isn't official I guess it could break someday.

Basically, there are a bunch of options that when strung together with an hyphen `-` and added to the image url, can dynamically change the image returned. The options that I found are:

`w` - returns an image with width X and variable height, maintaining original aspect ratio.
`h` - returns an image with height X and variable width, maintaining original aspect ratio.
`s` - an alias for `w`.
`c` - returns a square image.

These are the 4 options I'm using in this pull request. There are a couple more that I found though:

`d` - forces the image to be downloaded.
`g` - returns an xml file containing the image's base url.

And I'm pretty sure there are a lot more options to be discovered.

With this pull request, you can get images of pretty much any size. So this is the original picture:
https://lh6.googleusercontent.com/-TrRWo7SihiM/AAAAAAAAAAI/AAAAAAAAAEs/h8rjSd_wjms/photo.jpg

This is a thumbnail:
https://lh6.googleusercontent.com/-TrRWo7SihiM/AAAAAAAAAAI/AAAAAAAAAEs/h8rjSd_wjms/s50-c/photo.jpg

```ruby
{ :image_size => 50, :image_aspect_ratio => "square" }
```

And this is a large picture:
https://lh6.googleusercontent.com/-TrRWo7SihiM/AAAAAAAAAAI/AAAAAAAAAEs/h8rjSd_wjms/w1000-h1000/photo.jpg

```ruby
{ :image_size => { :width => 1000, :height => 1000 }
```