cordova-plugin-camera icon indicating copy to clipboard operation
cordova-plugin-camera copied to clipboard

fix(android): allowEdit not working when sourceType is PHOTOLIBRARY

Open hazems opened this issue 6 years ago • 6 comments

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

hazems avatar Feb 25 '19 02:02 hazems

Is there any chance this will be included in the next build of the plugin? Can I include this fix in my angular project?

mconti80 avatar May 01 '19 20:05 mconti80

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

hazems avatar May 05 '19 09:05 hazems

Hope this can be reviewed and merged soon, @timbru31! We too are relying on a fix for this issue for our app. Thanks! 😊

ishanAhuja avatar May 16 '19 13:05 ishanAhuja

hello @hazems, My app is closed now when I choose load from gallery

YaroslavG avatar Jun 04 '19 08:06 YaroslavG

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 avatar Jun 09 '19 16:06 hazems

@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

wxingheng avatar Nov 09 '19 15:11 wxingheng