https://github.com/thadeu/resize-image-canvas
Library from resize images using canvas JavaScript
https://github.com/thadeu/resize-image-canvas
Last synced: about 1 year ago
JSON representation
Library from resize images using canvas JavaScript
- Host: GitHub
- URL: https://github.com/thadeu/resize-image-canvas
- Owner: thadeu
- License: mit
- Created: 2017-11-07T01:51:26.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-27T22:14:59.000Z (about 8 years ago)
- Last Synced: 2025-04-02T12:01:42.629Z (about 1 year ago)
- Language: JavaScript
- Size: 200 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Resize Image to Canvas
# How to install lib
```bash
yarn add resize-image-canvas@latest
```
or
```bash
npm install resize-image-canvas@latest
```
# Using ES5/ES6,ES7,ES*
```javascript
import FileResize from 'resize-image-canvas'
document.querySelector('.resize-action').addEventListener('click', function(e){
e.preventDefault();
// using Array fro files
new FileResize({
boxPreview: document.querySelector('.previews'),
files: document.querySelector('.input-files').files,
width: 200,
height: 200,
loading: 'carregando...', // (opcional)
callback: function(){
}
})
})
}
```
# Using VanilhaJS or jQuery
Get to files with clone repo https://github.com/Thadeu/resize-image-canvas
After load file resize-image-canvas in your assets project path, so!
```html
```
### After use lib
```html
Selecione os arquivos
Iniciar
```
```javascript
$('.resize-action').on('click', function(e){
e.preventDefault();
// using Array fro files
new FileResize({
boxPreview: $('.previews'),
files: $('.input-files').files,
width: 200,
height: 200,
loading: 'carregando...', // (opcional)
callback: function(){
}
})
})
}
```
# Exemplo
See you exemple here! [Exemple Project using VanilhaJS](https://github.com/Thadeu/resize-image-to-fit)

# Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/Thadeu/resize-image-canvas