thegrizzlylabs / geniusscan-sdk-demo

Demo apps for Genius Scan SDK
30 stars 38 forks source link

Scanflow iOS with OCR creates duplicated images #70

Closed limajr closed 1 year ago

limajr commented 1 year ago

When using the Scanflow in iOS devices and having the OCR active, after the scan is taken and cropped, if the user clicks more than once quickly the "Done" button, the same scanned page appears multiple times in the pdf file created.

I believe while the text is being recognised, every time the "Done" a new same page is added in the scan. In the debug log we can see:

[PDF] Adding image to page with inches size: 8.27x0.00 [PDF] Page transformation: x:0.00, y:0.00, scale: 0.34 [PDF] Adding HOCR information [PDF] Adding image to page with inches size: 8.27x0.0 [PDF] Page transformation: x:0.00, y:0.00, scale: 0.34 [PDF] Adding HOCR information [PDF] Adding image to page with inches size: 8.27x0.0 [PDF] Page transformation: x:0.00, y:0.00, scale: 0.34 [PDF] Adding HOCR information ...

The obvious solution would be to deactivate the button "Done" after it is clicked once.

Maybe this is only an issue in relatively older iPhone models.

bvirlet commented 1 year ago

Have you tried the SDK 4.8.0? It solved several issues, some similar to what you describe.

limajr commented 1 year ago

yes, I just tried today with the latest SDK / module (4.8.0).

One the issues solved there is very similar, as you mentioned:

[ScanFlow] iOS: Fix bug where document detection could still be active when performing text recognition and PDF generation a on a document with many pages.

it is similar, but unfortunately it doesn't apply to this issue I described.

I also could replicate the issue just few minutes ago using purely this demo, just had to change the "multiPage" of the ScanFlow to "false" before running it in one of the test devices.