NeutrinosPlatform / cordova-plugin-document-scanner

cordova plugin for document scan
https://www.neutrinos.co/
MIT License
85 stars 59 forks source link

Android Variant: Keeps Photo in Albums/Pictures #63

Open bendspoons opened 4 years ago

bendspoons commented 4 years ago

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....

ChrisTomAlx commented 4 years ago

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

bendspoons commented 4 years ago

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?!

ChrisTomAlx commented 4 years ago

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

bendspoons commented 4 years ago

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

levi730 commented 4 years ago

@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!

bendspoons commented 4 years ago

@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.

fairojm commented 4 years ago

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

bastifix commented 4 years ago

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

fairojm commented 4 years ago

@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.

ChrisTomAlx commented 4 years ago

@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

fairojm commented 4 years ago

@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.

aorr76 commented 4 years ago

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!)

ChrisTomAlx commented 4 years ago

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