Skip to content

Instantly share code, notes, and snippets.

@uploadcare-user
Forked from dayton1987/straightforward.js
Created October 17, 2016 15:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save uploadcare-user/cfb9087c496cc5ba6ab3c1de94e096a5 to your computer and use it in GitHub Desktop.
Save uploadcare-user/cfb9087c496cc5ba6ab3c1de94e096a5 to your computer and use it in GitHub Desktop.
brr_blog_script0
function resizeImage(img, width, height) {
var canvas = document.createElement('canvas');
canvas.width = width;
canvas.height = height;
canvas.getContext('2d').drawImage(img, 0, 0, width, height);
return canvas;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment