4/13/2013 - 6:25 PM

Google’s authentication-less on-the-fly image resizing service

Google’s authentication-less on-the-fly image resizing service

# Google's authentication-less on-the-fly image resizing service

I found it while poking around the Google+ HTML.  Jotting down some notes felt
like a good idea, so here goes.  If you know more about this API, let me know,

(Word of warning: I spent ~30 minutes on both my experimentation and this here
write-up, so it might not be the most thought-provoking, brilliant thing you
read today.)

## Base URL


## Parameters:

* `url`: original image URL
* `container`: must be "focus" (i dunno lol)
* `refresh`: time (in seconds) to cache it on G's servers
* `resize_w`: width in pixels
* `resize_h`: height in pixels

You can either specify both `resize_*` parameters or just one.

## Examples

Let's resize [that big panorama picture I took in Istanbul last year][1].

Make it square, 300x300px:


Make it 750px wide and keep the aspect ration:


## Quirks

At least in Chrome, opening the URL in the browser will force a download of a text file (which is actually a JPG).  Putting the URL in an `<img>` tag is fine.  Or just use `curl`.

[1]: https://dl.dropboxusercontent.com/u/7298/blog/Blick_von_der_S%C3%BCleymaniye-Moschee.jpg