-
Notifications
You must be signed in to change notification settings - Fork 68
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
Plugin increases the file size after cropping in ionic .Cropped images are larger than original images #29
Comments
See the examples folder. You should use the toBlob function to turn it into a binary before transferring it. I have used the blueimp polyfill, I plan to shiv it in the future by default. I have not tested it with the File Transfer plugin, but using FormData() should work (also in examples). Let me know if that worked. |
I tired toBlob on android , It says canvas.toBlob is not a function but i found a workaround by reducing resolution through targetWidth and targetHeight in camera plugin. |
To use toBlob on Android you should include the polyfill. But you've found your own workaround. |
Thanks Anyways,
|
Ah cachebust! Thank you, I'll close this again when it's fixed. |
Yeah sure... 😄 |
The problem with your modification is that there are edge cases that I think need to be resolved to do something like this. It will probably break or throw errors when: 1) a user puts base64 data as url, 2) the url already contains a question mark. |
Yeah , you are absolutely correct. I think with base64 data cachebust wont be a problem so no modification is required.
because there must not be more than one question mark in the url and alse there must be some url variables after question mark. |
Original file was about 154 kb , after cropping it was 784kb . Another file was about 500kb which turned to 2.2 MB after cropping.
I used Cordova Camera plugin to get the File URI then i fed it to jr Crop function and then i saved it to the storage through File Transfer plugin
The text was updated successfully, but these errors were encountered: