thumb-component
Canvas thumbnail generator
Last updated 8 years ago by tjholowaychuk .
Original npm · Tarball · package.json
$ cnpm install thumb-component 
SYNC missed versions from official npm registry.

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

Current Tags

  • 1.0.5                                ...           latest (8 years ago)

6 Versions

  • 1.0.5                                ...           8 years ago
  • 1.0.4                                ...           8 years ago
  • 1.0.3                                ...           8 years ago
  • 1.0.2                                ...           8 years ago
  • 1.0.1                                ...           8 years ago
  • 0.0.1                                ...           8 years ago

Copyright 2014 - 2016 © taobao.org |