Skip to content

Latest commit

 

History

History
27 lines (21 loc) · 611 Bytes

readme.md

File metadata and controls

27 lines (21 loc) · 611 Bytes

use canvas to resize image

1. API

options = {
  file: file                              // HTMLImageElement or File
  maxWidth: 640
  maxHeight: 640
  callback: function(result) {},
  readAsDataURL: false,                   // by default return a blob
  keepExif: true                          // by default keep Exif for image/jpeg
}

resize(options);

click to view demo.

2. Development

$ npm install .
$ npm run build         // build for production
$ npm run watch         // watch to develop
$ npm test              // test in browser