1.1.0 • Published 5 years ago

uppy-plugin-image-compressor v1.1.0

Weekly downloads
347
License
MIT
Repository
github
Last release
5 years ago

Uppy Image Compressor

ImageCompressor is an Uppy file uploader plugin, that compresses images before upload, saving bandwidth.

ImageCompressor uses Compressor.js, 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, a versatile file encoding service.

Example

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

$ npm install uppy-plugin-image-compressor --save