You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 15, 2021. It is now read-only.
`console.log(sourceType);
var options = {
quality: 60,
destinationType: Camera.DestinationType.FILE_URI,
encodingType: Camera.EncodingType.JPEG,
sourceType: sourceType,
saveToPhotoAlbum: false
};
console.log(options);
$scope.hidePopup = false;
$scope.functionCalled = true;
$cordovaCamera.getPicture(options).then(function(imagePath) {
console.log(imagePath);
// Grab the file name of the photo in the temporary directory
var currentName = imagePath.replace(/^.*[\/]/, '');
//Create a new name for the photo
var d = new Date(),
n = d.getTime(),
newFileName = n + ".jpg";
// If you are trying to load image from the gallery on Android we need special treatment!
if ($cordovaDevice.getPlatform() == 'Android' && sourceType === Camera.PictureSourceType.PHOTOLIBRARY) {
window.FilePath.resolveNativePath(imagePath, function(entry) {
window.resolveLocalFileSystemURL(entry, success, fail);
function fail(e) {
console.error('Error: ', e);
}
function success(fileEntry) {
var namePath = fileEntry.nativeURL.substr(0, fileEntry.nativeURL.lastIndexOf('/') + 1);
// Only copy because of access rights
$cordovaFile.copyFile(namePath, fileEntry.name, cordova.file.dataDirectory, newFileName).then(function(success) {
$scope.image = newFileName;
$scope.uploadImage('profile_pic', $scope.image);
}, function(error) {
$scope.showAlert('Error', error.exception);
});
};
});
} else {
var namePath = imagePath.substr(0, imagePath.lastIndexOf('/') + 1);
// Move the file to permanent storage
$cordovaFile.moveFile(namePath, currentName, cordova.file.dataDirectory, newFileName).then(function(success) {
$scope.image = newFileName;
$scope.uploadImage('profile_pic', $scope.image);
}, function(error) {
$scope.showAlert('Error', error.exception);
});
}
// if(!$scope.hidePopup && $scope.functionCalled){
// $scope.showAlert('Success','Permited size exceeded');
// }
},
function(err) {
// Not always an error, maybe cancel was pressed...
})
};`
I'm able to get the first console message but not the one printing imagePath & also not getting any error message. Issue is only there in phones having android 4.4.X & on iPhone as well.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
`console.log(sourceType);
var options = {
quality: 60,
destinationType: Camera.DestinationType.FILE_URI,
encodingType: Camera.EncodingType.JPEG,
sourceType: sourceType,
saveToPhotoAlbum: false
};
console.log(options);
$scope.hidePopup = false;
$scope.functionCalled = true;
$cordovaCamera.getPicture(options).then(function(imagePath) {
console.log(imagePath);
// Grab the file name of the photo in the temporary directory
var currentName = imagePath.replace(/^.*[\/]/, '');
I'm able to get the first console message but not the one printing imagePath & also not getting any error message. Issue is only there in phones having android 4.4.X & on iPhone as well.
The text was updated successfully, but these errors were encountered: