https://github.com/sofish/resize.js
use canvas to resize image
https://github.com/sofish/resize.js
Last synced: over 1 year ago
JSON representation
use canvas to resize image
- Host: GitHub
- URL: https://github.com/sofish/resize.js
- Owner: sofish
- Created: 2016-06-29T10:00:30.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-06-30T10:32:45.000Z (about 10 years ago)
- Last Synced: 2025-04-23T16:06:26.806Z (over 1 year ago)
- Language: JavaScript
- Homepage: https://sofish.github.io/resize.js/
- Size: 91.8 KB
- Stars: 10
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# use canvas to resize image
## 1. API
```js
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](http://sofish.github.io/resize.js/).
## 2. Development
```bash
$ npm install .
$ npm run build // build for production
$ npm run watch // watch to develop
$ npm test // test in browser
```