jcesarmobile opened a new pull request #617:
URL: https://github.com/apache/cordova-plugin-camera/pull/617


   <!--
   Please make sure the checklist boxes are all checked before submitting the 
PR. The checklist is intended as a quick reference, for complete details please 
see our Contributor Guidelines:
   
   http://cordova.apache.org/contribute/contribute_guidelines.html
   
   Thanks!
   -->
   
   ### Platforms affected
   android
   
   
   ### Motivation and Context
   At the moment the plugin tries to guess (in a dirty way) the image path from 
the content url, but that's not really necessary since we know the path 
beforehand, and doesn't work at the moment since the path was changed in a 
previous PR causing #597 
   
   ### Description
   <!-- Describe your changes in detail -->
   probably breaking change since CordovaUri class says it's for Android 4.4.4 
and lower support, but since cordova-android 9 won't support versions older 
than 5.1, I think we can remove the class and we also need to update the plugin 
to use Android X, which will require cordova-android 9.
   
   What the PR does is to store the file path in a variable and use that 
variable to send the camera result instead of trying to guess the image path 
from the returned result from the camera intent, which was a dirty way of 
getting it (according to the method description) and which doesn't work since 
[this](https://github.com/apache/cordova-plugin-camera/commit/df1441420376696994d77f0856ab3dfbed5f0bbe)
 was merged.
   
   For that, it removes CordovaUri.java class and it's usages.
   Saves image paths in a variable to return.
   Changes the file_provider to use `cache_files` as the mentioned commit 
stores the images there.
   Removes code used for Android 4.4 and older.
   
   fixes https://github.com/apache/cordova-plugin-camera/issues/597
   
   ### Testing
   Tested on Android 5 and Android 9 devices with this code
   
   ```
   navigator.camera.getPicture(onSuccess, onFail, { quality: 50, 
destinationType: Camera.DestinationType.FILE_URI });
       function onSuccess(imageURI) {
           alert(imageURI);
           document.getElementById("photoResult").src = imageURI;
       }
       function onFail(message) {
           alert('Failed because: ' + message);
       }
   ```
   
   
   ### Checklist
   
   - [ ] 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](https://help.github.com/articles/closing-issues-using-keywords/))
   - [ ] I've updated the documentation if necessary
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to