WebsiteBeaver / react-native-document-scanner-plugin

A React Native document scanner plugin for Android and iOS
https://react-native-document-scanner.js.org/
MIT License
271 stars 53 forks source link

zero-size image when pressing X #62

Closed maimistery closed 1 year ago

maimistery commented 1 year ago

Hi, Screenshot_2023-02-09-15-02-05-272-edit_com android camera

When the user decides to press the X button, it leaves a file in the application directory of size 0, can this behavior be corrected? as it is in the image:

Screenshot_2023-02-09-15-38-56-352-edit_com google android documentsui

Thanks

maimistery commented 1 year ago

i have the last version 0.7.2

mwerder commented 1 year ago

Hey, I guess that will need a change inside the package WebsiteBeaver/android-document-scanner right?

I think we can clean up the file when the camera is canceled. I'd be glad to open a PR

Playing around with the scanner I also noticed that if you scan multiple pages, and then abort, the result will only contain {"status": "cancel"} So the file paths of the already scanned pages are never exposed to the react-native application to clean them up. Wouldn't it make sense to clean up all files after a user cancels the scanner? Or is there a reason to keep them?

maimistery commented 1 year ago

Right!

dmarcs commented 1 year ago

fixed in 0.7.3

https://github.com/WebsiteBeaver/android-document-scanner/pull/27

by deleting a photo when the user cancels or retakes