Created
July 26, 2017 14:39
-
-
Save michaeljymsgutierrez/f979800c962d91ea2ea04c5fadf3d9f5 to your computer and use it in GitHub Desktop.
Simple work around for picking image and converting to b64
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
| /* Initialize options */ | |
| var options = { | |
| quality: 50, | |
| destinationType: Camera.DestinationType.DATA_URL, | |
| sourceType: Camera.PictureSourceType.PHOTOLIBRARY, | |
| allowEdit: true, | |
| encodingType: Camera.EncodingType.JPEG, | |
| targetWidth: 800, | |
| targetHeight: 800, | |
| popoverOptions: CameraPopoverOptions, | |
| saveToPhotoAlbum: false | |
| }; | |
| /* Fire up camera */ | |
| $cordovaCamera.getPicture(options).then(function(imageData) { | |
| $scope.rawImage = "data:image/jpeg;base64," + imageData; | |
| }, function(err) { | |
| /* Encounter error */ | |
| console.log(err); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment