-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compression settings ignored when using Crop #113
Comments
This mainly has to do with our dependency for cropping, which returns PNGs. I think I can convert it post-result, let me see what I can do. 😄 |
I've just been looking at the cropperjs docs and it looks like you can use: Hope this helps in some small way. |
🎉 This issue has been resolved in version 3.0.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
From my initial testing this seems to be working great now, thank you. Also many thanks for the addition to the Contributors. We plan to contribute much more than just bug reports in the future. |
Thanks! Your contributions have been invaluable! You've found so many bugs, I'm happy to have you on the front page. :) |
@AnandChowdhary I am using this.uppload = new Uppload({
lang: en,
uploader: this.uploadHandler,
maxSize: [430, 430],
compression: 0.8,
compressionFromMimes: ["image/jpeg", "image/webp", "image/png"],
compressionToMime: "image/jpeg"
});
let camera = new Camera();
this.uppload.use([
new Local({
mimeTypes: ["image/png", "image/jpeg"]
}),
new Crop({aspectRatio: 1}),
new Rotate(),
new Brightness(),
new Contrast(),
new Saturate(),
camera
]);
// stop the camera when done
this.uppload.on('close', () => camera.stop()) |
@AnandChowdhary One more thing about compression, although I set Thanks for this amazing uploader, waiting for your response on this |
@saqueib I'll have to look into this, can you perhaps create an example on CodeSandbox or JSFiddle to reproduce it? The graininess of photos typically depends on your webcam quality (if you're using the Camera service) or perhaps an effect like Crop. Otherwise, if you upload a 5 MB high-resolution JPEG with on effects, it should upload that exact file in the same quality. |
Yes I am using Crop effect to resize image before uploading. How do I use this image resize library https://github.com/nodeca/pica |
If you want to use it for compression instead of our default helper, you can use the |
Describe the bug
When using the Crop plugin, the
compression
,compressionFromMimes
, andcompressionToMime
settings seem to be ignored - it simply uploads a PNG no matter what.Using v3.0.1
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The compression settings should be adhered to even when using the Crop function. The Blob image should somehow retain its original Mime type and convert to the
compressionToMime
if appropriate.Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: