arturi / uppy-plugin-image-compressor Goto Github PK
View Code? Open in Web Editor NEWCompresses images added to Uppy before upload, using compressorjs package
License: MIT License
Compresses images added to Uppy before upload, using compressorjs package
License: MIT License
Hi, thanks for the library! super easy to use
I was wondering if there was a way to compress to multiple file sizes, and then uploading all of those files. What I have so far is:
Uppy({
id: "post",
restrictions: {
maxFileSize: 10000000,
maxNumberOfFiles: 1,
allowedFileTypes: ["image/png", "image/jpeg"],
},
meta: {
postId: postId,
size: "small",
uploadPath: `website/post/${postId}/small`,
},
})
.use(ImageCompressor, {
id: "post_compressor",
quality: 0.8,
maxWidth: 1500,
maxHeight: 1500,
convertSize: 200000,
})
.use(AwsS3, {
id: "post_aws",
limit: 1,
companionUrl: baseServerUrl,
metaFields: ["postId", "size", "uploadPath"],
})
.on("upload-success", (file: any, data: any) => {console.log('success')})
I want to define 3 different compressors for 3 different image sizes. I've tried "chaining" the events like so:
.use(ImageCompressor, {...}).use(AwsS3,{...})
.use(ImageCompressor, {...}).use(AwsS3,{...})
.use(ImageCompressor, {...}).use(AwsS3,{...})
But that doesn't work for me. Any help would be appreciated, thanks!
When compressing a gif, the compressor removes the gif animation. Is there a way around this?
Hi,
Thanks for the awesome plugin!
Are u sure it's running fine when used with Dashboard
?
I managed to load it but doesn't do a thing.
Are there any special instructions to bootload it?
This is something that is needed by many users.
Please make this an official plugin for Uppy. ๐๐๐
The image compressor plugin for compressing images before upload to the server:
https://github.com/arturi/uppy-plugin-image-compressor/blob/master/src/index.js
Hello,
If I upload a gif, the image compressor will still compress it regardless of the convertSize or convertTypes option I pass in.
I have the following code:
this.uppy = Uppy({
restrictions: {
maxFileSize: 10000000,
maxNumberOfFiles: 1,
allowedFileTypes: [ 'image/png', 'image/jpeg', 'image/gif' ]
}
})
.use(ImageCompressor, {
maxWidth: 2048,
maxHeight: 2048,
convertTypes: ['image/png','image/jpeg'],
convertSize: 1000000
})
Why aren't the options working?
It's not running when image source is a URL
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.