Socket
Book a DemoInstallSign in
Socket

thumb-component

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

thumb-component

Canvas thumbnail generator

latest
npmnpm
Version
1.0.5
Version published
Maintainers
1
Created
Source

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

Keywords

thumb

FAQs

Package last updated on 02 May 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts