Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

thumb-component

1.0.5 • Public • Published

Thumb

Scale an image or data uri within the given dimensions.

canvas thumbnail image generator

Installation

$ npm install thumb-component

Example

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

License

MIT

install

npm i thumb-component

Downloadsweekly downloads

14

version

1.0.5

license

none

last publish

collaborators

  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar