hostcia opened a new issue #570: How to take a photo or select a file?
URL: https://github.com/apache/cordova-plugin-camera/issues/570
 
 
   How do I make sure that when I activate the camera, I can select whether I 
want to take a photo or select the image in the gallery?
   
   ```
   document.addEventListener("deviceready", onDeviceReady, false);
           function onDeviceReady() {
               $(document).on("click", ".tirarFoto", tirarFoto);
               function tirarFoto(e) {                    
   
                   navigator.camera.getPicture(onSuccess, onFail,{
                       quality: 35,
                       saveToPhotoAlbum: true,
                       destinationType: Camera.DestinationType.DATA_URL,
                       targetWidth: 800,
                       targetHeight: 0
                   });
   
                   function onSuccess(imageData) {
                       img_.src = "data:image/jpeg;base64," + imageData;
                       input_.value = img_.src;
                       $(input_).change();
                   }
   
                   function onFail(message){
                       alert('A camera falhou: ' + message);
                   }
               }
           }
   ```

----------------------------------------------------------------
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]


With regards,
Apache Git Services

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

Reply via email to