1.0.5 • Published 12 years ago

thumb-component v1.0.5

Weekly downloads
25
License
-
Repository
-
Last release
12 years ago

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

1.0.5

12 years ago

1.0.4

12 years ago

1.0.3

12 years ago

1.0.2

12 years ago

1.0.1

12 years ago

0.0.1

13 years ago