This question is locked. New answers and comments are not allowed.
I use this code to upload photos it works in Android and iOS, but in WinPhone it does not show the image on <img src=...> . However - when I save to the server later, the image gets uploaded as it should.
getImageFromPhotoLibrary(onSuccess: Function, onFail?: Function) {
var imageOptions = {
quality: 50,
destinationType: navigator.camera.DestinationType.FILE_URI,
targetWidth: 960,
targetHeight: 960,
srcPrefix: "",
sourceType: navigator.camera.PictureSourceType.PHOTOLIBRARY,
saveToPhotoAlbum: false
};
navigator.camera.getPicture(onSuccess, onFail, imageOptions);
}
...
cordovaNavigatorService.getImageFromPhotoLibrary((imageData) => {
var imageText = 'Bild ' + (1 + $scope.images.length);
if ($scope.newNote != '') imageText += " - " + $scope.newNote;
//cordovaNavigatorService.sendImage(imageData, 1);
$scope.images.push({ text: imageText, src: imageData });
$scope.newNote = "";
$scope.$apply();
});
...
<img ng-src="{{img.src}}" alt="bild" class="img-thumbnail" style="width: 205px;">
getImageFromPhotoLibrary(onSuccess: Function, onFail?: Function) {
var imageOptions = {
quality: 50,
destinationType: navigator.camera.DestinationType.FILE_URI,
targetWidth: 960,
targetHeight: 960,
srcPrefix: "",
sourceType: navigator.camera.PictureSourceType.PHOTOLIBRARY,
saveToPhotoAlbum: false
};
navigator.camera.getPicture(onSuccess, onFail, imageOptions);
}
...
cordovaNavigatorService.getImageFromPhotoLibrary((imageData) => {
var imageText = 'Bild ' + (1 + $scope.images.length);
if ($scope.newNote != '') imageText += " - " + $scope.newNote;
//cordovaNavigatorService.sendImage(imageData, 1);
$scope.images.push({ text: imageText, src: imageData });
$scope.newNote = "";
$scope.$apply();
});
...
<img ng-src="{{img.src}}" alt="bild" class="img-thumbnail" style="width: 205px;">