I am able to capture image .and it get stored at /storage/emulated/0/pictures(inside android device)…how can i access this image …i red that we can use ionic native native storage to acess the device files … i saw the following code in ionic site…please help me in using this to access my image
import { NativeStorage } from 'ionic-native';
NativeStorage.setItem('myitem', {property: 'value', anotherProperty: 'anotherValue'})then(
() => console.log('Stored item!'),
error => console.error('Error storing item', error)
);
NativeStorage.getItem('myitem')
.then(
data => console.log(data),
error => console.error(error)
);
my code for capturing image
takePicture(){
Camera.getPicture({
quality : 95,
destinationType : Camera.DestinationType.DATA_URL,
sourceType : Camera.PictureSourceType.CAMERA,
allowEdit : true,
encodingType: Camera.EncodingType.PNG,
targetWidth: 500,
targetHeight: 500,
saveToPhotoAlbum: true
}).then(imageData => {
const b64toBlob = (b64Data, contentType='', sliceSize=512) => {
const byteCharacters = atob(b64Data);
const byteArrays = [];
for (let offset = 0; offset < byteCharacters.length; offset += sliceSize) {
const slice = byteCharacters.slice(offset, offset + sliceSize);
const byteNumbers = new Array(slice.length);
for (let i = 0; i < slice.length; i++) {
byteNumbers[i] = slice.charCodeAt(i);
}
const byteArray = new Uint8Array(byteNumbers);
byteArrays.push(byteArray);
}
const blob = new Blob(byteArrays, {type: contentType});
return blob;
}
this.guestPicture = b64toBlob(imageData, 'image/png');
}, error => {
console.log("ERROR -> " + JSON.stringify(error));
});
}
actually i am trying to access this image in another typescript file( ie.not in the file that captures image)