https://github.com/arturi/uppy-plugin-image-compressor
Compresses images added to Uppy before upload, using compressorjs package
https://github.com/arturi/uppy-plugin-image-compressor
Last synced: about 2 months ago
JSON representation
Compresses images added to Uppy before upload, using compressorjs package
- Host: GitHub
- URL: https://github.com/arturi/uppy-plugin-image-compressor
- Owner: arturi
- License: mit
- Created: 2019-05-24T20:45:16.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-05T00:42:45.000Z (over 2 years ago)
- Last Synced: 2025-04-15T06:14:52.433Z (about 2 months ago)
- Language: JavaScript
- Size: 2.73 MB
- Stars: 21
- Watchers: 0
- Forks: 5
- Open Issues: 29
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Uppy Image Compressor
ImageCompressor is an [Uppy](https://uppy.io) file uploader plugin, that compresses images before upload, saving bandwidth.
ImageCompressor uses [Compressor.js](https://github.com/fengyuanchen/compressorjs), and the compression is lossy. From Compressor.js readme:
> JavaScript image compressor. Uses the Browser's native canvas.toBlob API to do the compression work, which means it is lossy compression. General use this to precompress a client image file before upload it.
:warning: This is not an official Uppy plugin, so no support is offered for it. Please use at your own risk.
Uppy is being developed by the folks at [Transloadit](https://transloadit.com), a versatile file encoding service.
## Example
```js
const Uppy = require('@uppy/core')
const ImageCompressor = require('uppy-plugin-image-compressor')const uppy = Uppy()
uppy.use(ImageCompressor, {
// Options from Compressor.js https://github.com/fengyuanchen/compressorjs#options, just don’t set `success` or `error`
})
```## Installation
```bash
$ npm install uppy-plugin-image-compressor --save
```