cordova-plugin-document-scanner icon indicating copy to clipboard operation
cordova-plugin-document-scanner copied to clipboard

Android Variant: Keeps Photo in Albums/Pictures

Open bendspoons opened this issue 5 years ago • 13 comments

On iOS, the scanner does not put the scanned image in the Pictures Folder of the iPhone, so it is only available in my App.

On Android, i think because of the "first Photo, then scan" Method, the Photo taken is placed in my Albums/Pictures Folder on Android. This is, at least in my case/app, an absolute no-go.

The Photo cannot be deleted by my App, because i only get the "scanned image" path, and not the Photo Path.

Is there a workaround like in the "Camera Plugin", to not put the image in my Albums?!

Thanks a lot!

PS. It seems that the image now is blurred in /pictures folder, but still full visible in scanSamples/ folder....

bendspoons avatar Sep 30 '19 15:09 bendspoons

Hey @bendspoons

Thanks for raising this issue.

There is a folder called scanSample being created in the root directory within which the camera clicked images are stored. As of now there is no option to delete this image after scan, but as a workaround you could find this folder programmatically and then delete it using another plugin.

As for the future plan, I will add this to our enhancements backlog and provide an option for users to view both ios and android in gallery if they require it or not if they don't.

Cheers, Chris Neutrinos

ChrisTomAlx avatar Oct 01 '19 07:10 ChrisTomAlx

Hi, thanks for your reply, i can delete the scanSample Folder, and all images in it. BUT, the Picture is somehow ALSO stored/put into my /Pictures Folder, where my "regular Fotos" are stored. And the filename in this folder ist completetly different from what the app returns and the name in the scanSmaple folder. Any ideas?!

bendspoons avatar Oct 07 '19 15:10 bendspoons

The image in the Pictures folder is the scanned image, which is the image URI that is being returned. Atleast that is the case for me. Could you share all three images and their locations with their names.

Cheers, Chris Neutrinos

ChrisTomAlx avatar Oct 07 '19 17:10 ChrisTomAlx

HI, sorry, i kinda forgot about this issue, because it was not that urgent, and i had other projects to manage. I'll look into this issue again

bendspoons avatar Nov 21 '19 15:11 bendspoons

@bendspoons did you ever figure anything out about this? I'm in the same situation. I know the real fix is backlogged, but I'm wondering if anybody has alternate suggestions.

Thanks!

levi730 avatar Feb 10 '20 04:02 levi730

@leci730 Nah, unfortunately nothing with which im satisfied. I remove the taken image via Code, but unfortunately the image is not removed immmediately, its kinda blurred in its folder.

bendspoons avatar Feb 10 '20 08:02 bendspoons

Hi anyone got the solution for this. i return the image as base64 still it stores the image in Camera , pictures and scanned image in scanSample Folder

fairojm avatar Feb 27 '20 10:02 fairojm

@fairojm I'm also still searching for a way to solve this.

bastifix avatar Apr 23 '20 08:04 bastifix

@bastifix i fixed this issue by deleting the folder and image manually. i didn't know it is the right way. i done this as a temporary fix.

fairojm avatar Apr 23 '20 11:04 fairojm

@fairojm you mean via code? Could you share the workaround code with us because I don't know when I will be able to look at this issue. In the meantime it could help someone who runs into this.

Cheers, Chris Neutrinos

ChrisTomAlx avatar Apr 23 '20 11:04 ChrisTomAlx

@ChrisTomAlx i delete the image using modified time (which is latest) after the scanned image is returned from the plugin. I think its not the safe way to delete. but i don't know the another way to fix this.

fairojm avatar Apr 23 '20 13:04 fairojm

When I open the Photos app I see 3 images for every scanned page. Uncropped/unprocessed images are in Camera and scanSample. They are the same image, but different filenames. The image in Pictures is the cropped image set by this plugin. I'm attempting to manually handle deletion using cordova-plugin-file iterating through scanSample and then deleting images from Pictures, but Photos seems to cache or hold for some reason?! Also, it's not practical to iterate through all photos in Camera attempting to guess which to delete based on timestamp or similar.

Any suggestions or update? It would be great if the enhancement cleaned up these images. Thanks! (Also, the plugin is great and has saved a ton of time!)

aorr76 avatar Jun 10 '20 19:06 aorr76

I am not sure when I will be able to take a look at this issue. If anyone is up for raising a pr, I could review any pr's that come my way.

Cheers, Chris Neutrinos

ChrisTomAlx avatar Jun 11 '20 09:06 ChrisTomAlx