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
Hi
I've started building apps only recently.I am building an app that takes a picture and compares the image with the images I have already uploaded in the pastec database.
I am currently developing the app with ionic 2 with the Pastec api.
I am able to take a photo and send the photo to the server.
Pastec reflects my search requests however I always get the error "IMAGE_NOT_DECODED" .
The following is my code.
scan() {
var options = {
destinationType: Camera.DestinationType.DATA_URL,
sourceType: Camera.PictureSourceType.CAMERA,
quality: 75,
allowEdit: false,
saveToPhotoAlbum: false
};
Camera.getPicture(options).then((imageData) => {
let base64Image = "data:image/jpeg;base64," + imageData;
console.log(imageData);
this.cameraSuccessCallback(imageData);
}, (err) => {
alert(err);
});
};
cameraSuccessCallback(imageData) {
console.log('called camera success callback');
let data = this.getApi(imageData);
data.subscribe(
res => {
console.log(res);
}
)
};
getApi(imageData) {
console.log('called getapi');
let headers = new Headers({
'AuthKey': 'my auth key'
});
let options = new RequestOptions({ headers: headers });
return this.http.post(
"https://api.pastec.io/indexes/vygfzrfgnqjwmmzzcvae/searcher",
imageData,
options).map(res => res.json());
}
};
The text was updated successfully, but these errors were encountered:
Hi
I've started building apps only recently.I am building an app that takes a picture and compares the image with the images I have already uploaded in the pastec database.
I am currently developing the app with ionic 2 with the Pastec api.
I am able to take a photo and send the photo to the server.
Pastec reflects my search requests however I always get the error "IMAGE_NOT_DECODED" .
The following is my code.
};
The text was updated successfully, but these errors were encountered: