Ionic picture showing ERR_INVALID_URL
up vote
0
down vote
favorite
Hi ionic I am trying to show pictures but I am getting ERR_INVALID_URL error. Here's the code
resimekle()
{
const options: CameraOptions = {
quality: 100,
destinationType: this.camera.DestinationType.FILE_URI,
encodingType: this.camera.EncodingType.JPEG,
mediaType: this.camera.MediaType.PICTURE
}
this.camera.getPicture(options).then((imageData) => {
// imageData is either a base64 encoded string or a file URI
// If it's base64 (DATA_URL):
this.base64Image = 'data:image/jpeg;base64,' + imageData;
this.base64Image= this.base64Image.replace(/^file:///, '');
}, (err) => {
// Handle error
});
}
<img [src]="_DomSanitizationService.bypassSecurityTrustUrl(base64Image)"/>
ERROR: data:image/jpeg;base64,file:///storage/emulated/0/Android/data/io.ionic.starter/cache/1542647016224.jpg net::ERR_INVALID_URL
image ionic-framework camera base64
add a comment |
up vote
0
down vote
favorite
Hi ionic I am trying to show pictures but I am getting ERR_INVALID_URL error. Here's the code
resimekle()
{
const options: CameraOptions = {
quality: 100,
destinationType: this.camera.DestinationType.FILE_URI,
encodingType: this.camera.EncodingType.JPEG,
mediaType: this.camera.MediaType.PICTURE
}
this.camera.getPicture(options).then((imageData) => {
// imageData is either a base64 encoded string or a file URI
// If it's base64 (DATA_URL):
this.base64Image = 'data:image/jpeg;base64,' + imageData;
this.base64Image= this.base64Image.replace(/^file:///, '');
}, (err) => {
// Handle error
});
}
<img [src]="_DomSanitizationService.bypassSecurityTrustUrl(base64Image)"/>
ERROR: data:image/jpeg;base64,file:///storage/emulated/0/Android/data/io.ionic.starter/cache/1542647016224.jpg net::ERR_INVALID_URL
image ionic-framework camera base64
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
Hi ionic I am trying to show pictures but I am getting ERR_INVALID_URL error. Here's the code
resimekle()
{
const options: CameraOptions = {
quality: 100,
destinationType: this.camera.DestinationType.FILE_URI,
encodingType: this.camera.EncodingType.JPEG,
mediaType: this.camera.MediaType.PICTURE
}
this.camera.getPicture(options).then((imageData) => {
// imageData is either a base64 encoded string or a file URI
// If it's base64 (DATA_URL):
this.base64Image = 'data:image/jpeg;base64,' + imageData;
this.base64Image= this.base64Image.replace(/^file:///, '');
}, (err) => {
// Handle error
});
}
<img [src]="_DomSanitizationService.bypassSecurityTrustUrl(base64Image)"/>
ERROR: data:image/jpeg;base64,file:///storage/emulated/0/Android/data/io.ionic.starter/cache/1542647016224.jpg net::ERR_INVALID_URL
image ionic-framework camera base64
Hi ionic I am trying to show pictures but I am getting ERR_INVALID_URL error. Here's the code
resimekle()
{
const options: CameraOptions = {
quality: 100,
destinationType: this.camera.DestinationType.FILE_URI,
encodingType: this.camera.EncodingType.JPEG,
mediaType: this.camera.MediaType.PICTURE
}
this.camera.getPicture(options).then((imageData) => {
// imageData is either a base64 encoded string or a file URI
// If it's base64 (DATA_URL):
this.base64Image = 'data:image/jpeg;base64,' + imageData;
this.base64Image= this.base64Image.replace(/^file:///, '');
}, (err) => {
// Handle error
});
}
<img [src]="_DomSanitizationService.bypassSecurityTrustUrl(base64Image)"/>
ERROR: data:image/jpeg;base64,file:///storage/emulated/0/Android/data/io.ionic.starter/cache/1542647016224.jpg net::ERR_INVALID_URL
resimekle()
{
const options: CameraOptions = {
quality: 100,
destinationType: this.camera.DestinationType.FILE_URI,
encodingType: this.camera.EncodingType.JPEG,
mediaType: this.camera.MediaType.PICTURE
}
this.camera.getPicture(options).then((imageData) => {
// imageData is either a base64 encoded string or a file URI
// If it's base64 (DATA_URL):
this.base64Image = 'data:image/jpeg;base64,' + imageData;
this.base64Image= this.base64Image.replace(/^file:///, '');
}, (err) => {
// Handle error
});
}
resimekle()
{
const options: CameraOptions = {
quality: 100,
destinationType: this.camera.DestinationType.FILE_URI,
encodingType: this.camera.EncodingType.JPEG,
mediaType: this.camera.MediaType.PICTURE
}
this.camera.getPicture(options).then((imageData) => {
// imageData is either a base64 encoded string or a file URI
// If it's base64 (DATA_URL):
this.base64Image = 'data:image/jpeg;base64,' + imageData;
this.base64Image= this.base64Image.replace(/^file:///, '');
}, (err) => {
// Handle error
});
}
image ionic-framework camera base64
image ionic-framework camera base64
asked Nov 19 at 17:11
Yasin Dinç
11
11
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53379591%2fionic-picture-showing-err-invalid-url%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown