Я пытаюсь взять фотографию с камеры и скопировать снятую фотографию в новый каталог с новым именем.Я правильно создаю «Мой каталог», но когда «Копировать изображение из папки камеры в мою новую папку», он предупреждает меня об этой ошибке: ENCODING_ERR
Это мой код:
Image: any;
takePicture() {
var options = {
quality: 100,
destinationType: this.camera.DestinationType.DATA_URL,
encodingType: this.camera.EncodingType.JPEG,
mediaType: this.camera.MediaType.PICTURE,
saveToPhotoAlbum: true,
};
// Get the data of an image
this.camera.getPicture(options).then((imageData) => {
// imageData is either a base64 encoded string or a file URI
// If it's base64 (DATA_URL):
this.Image= "data:image/jpeg;base64," + imageData;
this.currentName = this.Image.replace(/^.*[\\\/]/, '');
this.correctPath = this.Image.substr(0, this.Image.lastIndexOf('/') +
1);
}, (err) => {
// Handle error
});
}