Skip to content

Repository files navigation

Thumb

Scale an image or data uri within the given dimensions.

canvas thumbnail image generator

Installation

$ npm install thumb-component

Example

varthumb=require('thumb');varinput=document.querySelector('input');input.onchange=function(e){varreader=newFileReader;reader.onload=function(){thumb(reader.result,200,200,function(err,img,datauri){document.body.appendChild(img);});};reader.readAsDataURL(input.files[0]);};

License

MIT

About

Scale an image or data uri within the given dimensions

Resources

Stars

13 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages