Last active
May 5, 2016 22:27
-
-
Save DorkNstein/dd62b4d785f98e051964cf769d85ed7a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uploadPicture = function(){ | |
navigator.camera.getPicture(onSuccess, onFail, { | |
quality: 100, | |
destinationType: Camera.DestinationType.FILE_URI, | |
sourceType: 2, // 1 for camera, 2 for gallery | |
allowEdit: true, // Can edit the pictures and lets the user pick gallery app | |
mediaType: Camera.MediaType.PICTURE, | |
encodingType: Camera.EncodingType.JPEG, | |
popoverOptions: CameraPopoverOptions, | |
// targetWidth: 500, | |
// targetHeight: 500, | |
saveToPhotoAlbum: false, | |
correctOrientation: true // false: switches the height and width }); | |
function onSuccess(imageURI) { | |
var image = document.getElementById('upload-img'); | |
image.src = imageURI; | |
} | |
function onFail(message) { | |
alert('Failed because: ' + message); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment