cordova-plugin-camera
cordova-plugin-camera copied to clipboard
fix(android): allowEdit not working when sourceType is PHOTOLIBRARY
Platforms affected
Android
Motivation and Context
allowEdit is not respected when source type is set to PHOTOLIBRARY. Looking into the code of the Camera plugin, I found that this case was never handled and allowEdit never launches cropping tool at all for Android versions >= Marshmallow.
This issue is reported in #393
Description
In order to solve this issue, I made sure that performCrop is called when allowEdit is set to true for PHOTOALBUM and introduced an extra new parameter to performCrop method in order to determine the source type to properly set request codes for Camera and Photo Album cropping cases.
Testing
I did manual testing to test all various test cases that I have and all pass fine. I also run paramedic unit tests and they runs perfectly in my emulator.
Checklist
- [x] I've run the tests to see all new and existing tests pass
- [ ] I added automated test coverage as appropriate for this change
- [x] Commit is prefixed with
(platform)if this change only applies to one platform (e.g.(android)) - [x] If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct keyword to close issues using keywords)
- [ ] I've updated the documentation if necessary
Is there any chance this will be included in the next build of the plugin? Can I include this fix in my angular project?
Is there any chance this will be included in the next build of the plugin? Can I include this fix in my angular project?
Please thumb it up so so it can be merged. thanks
Hope this can be reviewed and merged soon, @timbru31! We too are relying on a fix for this issue for our app. Thanks! 😊
hello @hazems, My app is closed now when I choose load from gallery
hello @hazems, My app is closed now when I choose load from gallery
This PR is not merged yet? which version of plugin are you using? What is your OS/device information? Do you have a sample that replicates the issue?
If yes, feel free to open a new issue, and we will look into it.
Thanks
@hazems I took the initiative to merge ARR-233, locally, but no effect. (android) allowEdit not working when sourceType is PHOTOLIBRARY error still exists. Can I help you? Android 7.0