I am using the camera plugin (currently using version 4.0.3) - and calling it as below:
navigator.camera.getPicture(appHandler.listPhoto, appHandler.photoFail, {
quality: 80,
saveToPhotoAlbum: false,
PictureSourceType: Camera.PictureSourceType.CAMERA,
destinationType: Camera.DestinationType.DATA_URL,
encodingType: Camera.EncodingType.JPEG
});
With saveToPhotoAlbum to false. This all works fine on Android and iOS - apart from I am finding the image can sometimes still appear in the photo gallery for samsung devices (tested on several Samsung G8 handhelds). This hasn't been an issue for other android handsets or iOS versions of the mobile app.
I think I know what might be causing the problem though - The devices have Samsung Cloud setup and I believe it is backing up the image when the above call is made and duplicates it in the background for Cloud backup. Something I am guessing is beyond the control of Cordova plugin.
I think the original image data is still deleted as per the checkForDuplicateImage function within the plugin-camera code (I had a look around the plugin code to understand how it works) but the plugin creates the image file first regardless (so it can return the base64 data of the image as per the DATA_URL option above).
My theory is that the gallery app on the device is picking up the Samsung cloud version that it duplicated during this process (e.g. the location details for the image still showing in the photo gallery was :/samsung cloud/DCIM/Camera/2018-0815_160311.jpg).
Question - has anyone else had this problem and can recommend a solution so the images do not save into the photo roll, gallery app on Samsung devices and Samsung cloud isn't effecting it. I have reported this also as a potential bug to https://issues.apache.org/jira/browse/CB-14269?filter=-2
Thank you!