Github user shaoner commented on the pull request:

    
https://github.com/apache/cordova-plugin-camera/pull/160#issuecomment-181769966
  
    @riknoll yes, actually if you don't set correctOrientation to true, 
getRealPath is never called, it returns the uri instead (I don't see why) so 
this is not empty:
    ```java
                 if (this.targetHeight == -1 && this.targetWidth == -1 &&
                         (destType == FILE_URI || destType == NATIVE_URI) && 
!this.correctOrientation) {
                     this.callbackContext.success(uri.toString());
    ```
    
    However, I think we have two issues here:
    1. getRealPath should be called even with correctOrientation set to false
    2. `FileHelper.getRealPathFromURI_API19` throws an exception, returning an 
empty path in some cases:
       - happens with my galaxy S4 device (android v5.0.1) and I guess it 
cannot be reproduced with a S4 emulator unless the same rom is used 
       - does not happen with a nexus S emulator (android v5.1.1)
    
    ( this seems to be the case for LG G3 as well, 
http://stackoverflow.com/questions/2789276/android-get-real-path-by-uri-getpath/33074944#33074944
 )
    
    For now, I've got it working by returning `getRealPathFromURI_BelowAPI11` 
if the path is empty.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to