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

Readme

Keywords

Package Sidebar

Install

npm i thumb-component

Weekly Downloads

2

Version

1.0.5

License

none

Last publish

Collaborators

  • defunctzombie
  • dfcreative
  • tjholowaychuk
  • jongleberry
  • dominicbarnes
  • tootallnate
  • rauchg
  • retrofox
  • coreh
  • forbeslindesay
  • kelonye
  • mattmueller
  • yields
  • anthonyshort
  • ianstormtaylor
  • cristiandouce
  • swatinem
  • stagas
  • amasad
  • juliangruber
  • calvinfo
  • blakeembrey
  • timoxley
  • jonathanong
  • queckezz
  • nami-doc
  • clintwood
  • thehydroimpulse
  • stephenmathieson
  • trevorgerhardt
  • timaschew
  • hughsk