You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2019/07/08 12:53:54 UTC

[GitHub] [cordova-plugin-camera] LousyJohnny opened a new issue #475: On Browser, camera.getPicture({DestinationType.FILE_URI}) returns base64image data

LousyJohnny opened a new issue #475: On Browser, camera.getPicture({DestinationType.FILE_URI}) returns base64image data
URL: https://github.com/apache/cordova-plugin-camera/issues/475
 
 
   # Bug Report
   
   ## Problem
   
   ### What is expected to happen?
   I expected the URI of the selected image 
   
   ### What does actually happen?
   I get a lengthy string of base64 encoded data
   
   
   ## Information
   The code below displays something like 
   - "content://media/external/....." when deployed on android
   - tens of KB of "/9j/4AAQSkZJRgABAQEASABIAAD..."  when running on browser platform
   
   ```
     camOptionLibrary: CameraOptions = {
       sourceType: this.camera.PictureSourceType.PHOTOLIBRARY,
       mediaType: this.camera.MediaType.PICTURE,
       destinationType: this.camera.DestinationType.FILE_URI,
       encodingType: this.camera.EncodingType.JPEG,
     };
   
   
     private selectPic() {
       this.camera
       .getPicture(this.camOptionLibrary)
       .then((photo) => {
         console.log(photo);
         this.base64image = photo;
         this.showErrorAlert('uri', photo);
       }).catch((error) => {
         console.log("error");
         console.log(error);
         this.showErrorAlert("Photo impossible", "Impossible d'accéder a la galerie");
       });
     }
   ```
   
   ### Version information
   <!-- 
   cordova -v
   8.0.0
   in package.json :
       "@ionic-native/camera": "^5.9.0",
       "cordova-plugin-camera": "4.0.3",
   
   
   ## Checklist
   <!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
   
   - [x] I searched for existing GitHub issues
   - [x] I updated all Cordova tooling to most recent version
   - [x] I included all the necessary information above
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org