OSS-DocumentScanner icon indicating copy to clipboard operation
OSS-DocumentScanner copied to clipboard

App freezes after image capture and scanning text

Open billie80 opened this issue 2 years ago • 16 comments

I don't know if this is fixed with newer versions but due to bug #29 I can only test up to version 1.2.5.12. After recording the image and defining the capture region the preview is shown but it says "computing..." forever. Closing the App and reopening allows to continue with scanning the text. When scanning the text, again it gets stuck at detecting text (100%)... Closing the App and reopening allows to take a look at the scanned text.

This is on a device running Android 10.

billie80 avatar Dec 23 '23 10:12 billie80

yes this is already fix. it was a regression. all dialog showing were not hiding.

farfromrefug avatar Dec 23 '23 11:12 farfromrefug

Thanks for letting me know. Feel free to close this issue.

billie80 avatar Dec 23 '23 12:12 billie80

@billie80 I LL wait for you to confirm it is fixed once the other one is fixed.

farfromrefug avatar Dec 23 '23 13:12 farfromrefug

If I set the system language to English I am able to use the newest version. Now the dialogues close as expected!

billie80 avatar Dec 23 '23 17:12 billie80

@farfromrefug This issue still exists. To start off, "computing" would take around 20-30 seconds per capture/page on my Pixel 7 Pro, which in itself leaves room for improvement.

But once when my screen turned off after a full minute at the "computing" stage, I could never get it to finish loading. When I force closed the app, I went back to see all the previous captures (pages) had been deleted also. Since it took a long time to capture each of those, this was extremely frustrating for me.

Edit: This was on v 1.5.11.68 from Fdroid

ghost avatar May 04 '24 21:05 ghost

@48-mq sorry to hear that. Definitely an issue here. A few questions:

  • could you try latest?
  • is auto scan enabled ?
  • what is the camera resolution ? (You can get it from the settings button on the camera view)

farfromrefug avatar May 05 '24 06:05 farfromrefug

Okay, I installed the latest version (1.7.0.70) from F-Droid, fortunately it had built and made the newest one available for download already.

Starting with the default settings after install, I clicked on the capture button to have the popup informing about auto scan. In contrast to my last time using the app, this time I chose to click on "Enable" to proceed with auto scan, in the hopes that this would potentially remove the freezing issue (and also the use of the magnifier tool). However, I found that the app had simply frozen. I could still turn the flash on or off, and the camera was still working, but the rest of the app around it had frozen completely. I had to force close the app.

I then started the app, went in to Settings to disable auto-scan, hit the capture button, and captured my page. It took about 5 or 6 seconds to actually capture the picture, which is too long for this phone and hardware. Usually even in low-light conditions the camera app (and the Google Drive app) capture instantly - I would estimate < 150ms. But I had the flashlight turned on in continuous mode (not in flash mode), so the shutter speed could not have been so slow.

Then, when the capture was completed, it went to the "computing" stage, and I started timing it. The flashlight came back on at this "computing" stage, even though the app's camera was not capturing. After about 25 seconds, the phone screen turned off, and upon turning it back on, I found the app had frozen to a black screen, so I had to force close it yet again.

It seems this could very well be a number of different bugs manifesting together instead of just one.

Aside from auto scan, all other settings were at their factory defaults for both these tests. Here's a screenshot of the camera resolution settings:

Screenshot_20240505-081651

ghost avatar May 05 '24 12:05 ghost

I have the same issues on a Pixel 6a (Android 14 QPR2) with the following camera settings in the app: preview stretch "aspectFit", view size "limited", aspect ratio "4:3", picture size "4000x3000".

If you need any logs, just let me know.

min7-i avatar May 05 '24 15:05 min7-i

@48-mq @min7-i thanks for the detailed report. Not sure what's going on. Could indeed be many thing. One big issue is that i dont have such a phone, and on the phones i have and those i have tested on it is much faster (with a resolution close to yours). I will try to find a phone like yours to test it, but it mike take some time :s Those phones are on stock rom?

farfromrefug avatar May 05 '24 19:05 farfromrefug

@farfromrefug Correct, my Pixel 7 Pro is running the stock Android 14 ROM with the latest OTA and no bootloader/root modifications.

I will try to test other settings to see if I can find any more clues to help you troubleshoot.

ghost avatar May 05 '24 19:05 ghost

@48-mq i just published a new version where capture should be much faster. I still see a random bug where the app gets stuck on capturing. Not sure if it comes from me or from android camera lib. If you see that bug please report it to me

farfromrefug avatar May 17 '24 14:05 farfromrefug

@farfromrefug Wow, this new version is really super smooth in the capture process, PLUS it fixes that other bug in previous versions (related to the flash) that I hinted at in #194 but didn't even get a chance to post an issue for yet!

I'll post here if the app gets stuck again.

This is amazing progress, merci beaucoup! 😃

ghost avatar May 17 '24 15:05 ghost

Oops, I may have started celebrating too soon. Turns out the app always (consistently) stops responding if the screen ever turns off while the camera is on (or while the "capturing" message is displayed).

But it now seems to be okay if the screen goes off while "computing" is displayed.

ghost avatar May 17 '24 15:05 ghost

Additionally, sometimes when the captured image is cropped, the app seems to take forever at the "computing" step (eventually causing the screen to turn off which then completely freezes the app).

ghost avatar May 17 '24 16:05 ghost

Oops, I may have started celebrating too soon. Turns out the app always (consistently) stops responding if the screen ever turns off while the camera is on (or while the "capturing" message is displayed).

But it now seems to be okay if the screen goes off while "computing" is displayed.

ok good hint on how to reproduce it. The fact you are also seeing what i am seeing is a good hint too. Now time to fix which wont be that easy :)

farfromrefug avatar May 17 '24 18:05 farfromrefug

@48-mq new version is up. I might have got it this time. Let me know how it goes

farfromrefug avatar May 18 '24 12:05 farfromrefug