Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 71529

Camera show picture on emulator but not on device

$
0
0

@GabrielBarreto wrote:

I'm using Genymotion emulator and > ionic run android and here is what i get:

But when i try > ionic build android and install it on my device, this is what i get:

A blank square.

Here is my code:

MY HTML:
<button class="button button-block button-royal" ng-click="escolhefotoperfil()">Escolha uma foto para o perfil!</button>
<img id="fotoperfil" ng-show="fotoperfil !== undefined" ng-src="{{fotoperfil}}"></img>
<br /><br />
<button class="button button-block button-calm" ng-click="salvarUsuario(nomeperfil, snperfil, fotoperfil)">Salvar</button>

MY APP.JS:
$scope.escolhefotoperfil = function(){
var options = {
quality: 65,
destinationType: Camera.DestinationType.DATA_URL,
sourceType: Camera.PictureSourceType.PHOTOLIBRARY,
allowEdit: false,
encodingType: Camera.EncodingType.JPEG,
targetWidth: 300,
targetHeight: 300,
saveToPhotoAlbum: false
};
$cordovaCamera.getPicture(options).then(function (imageData) {
$scope.fotoperfil = "data:image/jpeg;base64," + imageData;
}, function (err) {
$scope.errofoto = "Erro ao escolher foto: " + err.message;
});
};

Can someone shine me a light?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 71529

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>