Skip to content

Instantly share code, notes, and snippets.

@longle255
Forked from nblenke/Google Image Resize Proxy
Created February 21, 2020 13:40
Show Gist options
  • Save longle255/186902a2dd5c18e8d99dd6876c2fdb47 to your computer and use it in GitHub Desktop.
Save longle255/186902a2dd5c18e8d99dd6876c2fdb47 to your computer and use it in GitHub Desktop.
Use Google's Image caching/optimization proxy to resize an image
(function () {
var img = document.createElement('img');
path = encodeURIComponent('https://s3.amazonaws.com/llama0/burningfiremonkey.gif'),
width = 600,
refresh = 2592000;
img.src = 'https://images1-focus-opensocial.googleusercontent.com/gadgets/proxy?url=' + path + '&resize_w=' + width + '&container=focus&refresh=' + refresh;
document.body.appendChild(img);
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment