Created
October 8, 2014 15:44
-
-
Save whisher/114c07a6fc0bf38ced08 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| function takePhoto() { | |
| navigator.camera.getPicture(cameraSuccess, cameraError, { | |
| quality : 50, | |
| destinationType: Camera.DestinationType.DATA_URL | |
| }); | |
| } | |
| function cameraSuccess(imageData) { | |
| //Get a handle to the image container div | |
| ic = document.getElementById('imageContainer'); | |
| //Then write an image tag out to the div using the | |
| //URL we received from the camera application. | |
| ic.innerHTML = '<img src="' + "data:image/jpeg;base64," + imageData + '" width="50%" />'; | |
| myFirebaseRef.set({ | |
| data:imageData | |
| }); | |
| alert('Done'); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment