JSPM

uppy-plugin-image-compressor

1.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 389
  • Score
    100M100P100Q99261F
  • License MIT

Compresses images added to Uppy before upload, using Compressor.js package (lossy compression)

Package Exports

  • uppy-plugin-image-compressor

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (uppy-plugin-image-compressor) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Uppy Image Compressor

Uppy logo: a superman puppy in a pink suit

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.

⚠️ 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