-
Notifications
You must be signed in to change notification settings - Fork 287
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
cropped image results in bigger filesize #98
Comments
Hi, Yes, I did not pay attention to file size after cropping, and forgot about the second parameter for function.
This decision will help for cropping jpeg files, they will not be treated as 'image/png' files. But it will not help for cropping png files, they size will stay bigger. |
That would be perfect for me ! All good for me, waiting your realease 😊 |
Any news about it? |
Done. |
thank you !! |
Hi (again) !
I have another problem which concerns the image cropping functionnality.
Actually, when i crop an image via your file-manager, the resulted file size of the image is way bigger than the original one, even if the image size is smaller.
I did some research, and actually found the problem here :
https://github.com/alexusmai/vue-laravel-file-manager/blob/de26565b6f47d3c94e32decdb27f79f8ac8b7df5/src/components/modals/additions/Cropper.vue#L247
The "toBlob()" API here is generating the image in "image/png" format by default.
see API doc here : HTMLCanvasElement.toBlob() API
This API takes 3 arguments. If you give the image format "image/jpeg" as 2nd argument, the generated image filesize would be smaller.
The 3rd argument is the quality, but the default value (0.92) seems to be the best one here. I tried to put 100% quality, but the filesize increased a lot.
This fix would be pretty fast. Would it be possible to update your code to save the cropped image in image/jpeg format ?
thanks a lot for your help.
The text was updated successfully, but these errors were encountered: