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/01/16 05:24:02 UTC

[GitHub] merbin2012 opened a new issue #411: Error "No Image Selected"

merbin2012 opened a new issue #411: Error "No Image Selected"
URL: https://github.com/apache/cordova-plugin-camera/issues/411
 
 
   It doesn't work when I using the captured image using the camera. It always returns "No Image Selected".
   
   
   Code 1
   ```
   function getpic() 
     { 
      navigator.camera.getPicture(cameraCallback, onFail, 
      { 
       destinationType: Camera.DestinationType.DATA_URL 
      }); 
     } 
    
     function cameraCallback(imageData) 
     { 
      var image = document.getElementById('myImage'); 
      image.src = "data:image/jpeg;base64," + imageData; 
     } 
    
     function onFail(message) 
     { 
      alert('Failed because: ' + message); 
     }
   ```
   
   
   
   Code 2
   ```
   function getpic() 
     { 
      navigator.camera.getPicture(cameraCallback, onFail, 
      { 
       destinationType: Camera.DestinationType.DATA_URL,
       sourceType: Camera.PictureSourceType.CAMERA ,
      }); 
     } 
    
     function cameraCallback(imageData) 
     { 
      var image = document.getElementById('myImage'); 
      image.src = "data:image/jpeg;base64," + imageData; 
     } 
    
     function onFail(message) 
     { 
      alert('Failed because: ' + message); 
     }
   ```
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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