Closed kdmakwana43 closed 4 years ago
Here is my code for save image
const path = FileSystem.path.join(this.appRootFolder, `${this.imageName}.jpg`);
const source = new ImageSource();
source.fromAsset(this.newImageAsset).then((result) => {
const saved = source.saveToFile(path, "jpg");
if (saved) {
//his.imageName will provide user's provided image name
this.showAlert(`Saved image ${this.imageName}.jpg`);
setTimeout(() => {
this.removeImage(); // this will remove preview image
},1000);
}
});
Finally! i solved this issue, I scanned media and its done. Here is my code.
var callback = new android.media.MediaScannerConnection.OnScanCompletedListener({
onScanCompleted: function (path, uri) {
console.log(path)
}
});
android.media.MediaScannerConnection.scanFile(applicationModule.android.context, [path], null, callback);
Hello, I created a nativescript app for camara related app. I am taking a photo using
nativescript-camara
module.once user take a photo I am showing that image preview, as well as user can rename that image name. When user save that image I stored into a specific folder and removing preview image which stored by
nativescript-camara
module.after that, i can see that image in the gallery but not the original image, I can only blank image in the gallery. I also checked that image is exist on that location where is saved it. That means, Image saving work perfects but not showing that image in the gallery immediately. After 5-10 minutes i can see that image in gallery. But not an immediately.
here is some screenshot
Gallery view![Screenshot 2019-09-13 at 12 18 20 PM](https://user-images.githubusercontent.com/20925733/64842691-a78f6180-d620-11e9-909c-be97430b2c30.png)
Opened that broken image![WhatsApp Image 2019-09-13 at 11 58 09 AM (1)](https://user-images.githubusercontent.com/20925733/64842788-db6a8700-d620-11e9-8ea0-c83c52d55c41.jpeg)
The image on his location![WhatsApp Image 2019-09-13 at 11 58 09 AM](https://user-images.githubusercontent.com/20925733/64842811-f2a97480-d620-11e9-8656-2a698f71a269.jpeg)