-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OCR from Recent Files view takes forever #235
Comments
Cannot reproduce with the newest version (4.6.0) which comes with integration of #244 |
So... i had upgraded to recent NextCloud yesterday already (17.something) and i think i also upgraded to OCR 4.4.something in the process. From Recent view: gave up after 2 minutes Then i upgraded to most recent OCR App version, 4.6.1. From recent file view: gave up after 3 minutes So for me it seems broken completely now :-| I'll probably have some time at the weekend to give this some further testing if it helps you. Whlie i wrote this, the stop watch passed the 7 minute mark... still running oO... |
Ok. Wow. For me (local development and test setup AND production setup on server) it works just perfectly. I took the time and on my production setup (also Firefox 70) it took 13 sec for a png and 28 sec for single page pdf. |
Can you test it with the newest version and give feedback? For me it works. |
so, updated to NC 17.0.3 today and in the process also made the upgrade to OCR 6.0.3. I tried to repro the issue from the "Recent files" view and it was directly reproducible - so i thought. After a few seconds an error popup/toast was shown that there was some tesseract issue. I was not fast enough to copy the error message apparently. Then I tried again to reproduce from the recent files menu, to get the exact error message for this issue. However, then i got an error message the the target file existed. Of course, i had forgotten to delete the file i created. I then renamed the existing file and retried... It worked now... I'll keep an eye on this. I consider it working now. If i see something weird which is reproducible I will either log a new issue or add info to this one if it is okay... |
So... I came home today to find a bill in the snail mail. So i used my photo-scan-app to scan it and NextCloud for Android App is set up to automatically sync this document to NC. Tried my luck:
So i used the "..." menu to go to the file in the folder and used "..." menu to OCR the file from there. Worked great again... Then i thought "well maybe it is alway the first time it fails". And this seems to be key to the problem here. Went back to the "recent file" view, used the "..." Menu to OCR the second image. Worked like a charm... So now i guess the defect here is OCR from recent file view fails when it is the first time OCR is used in a NC WebUI Session
|
logs are in the browser console. Would help to have them here, for that problem. |
Hi, just tried again. This is from my console, hope it helps find the problem:
|
Just that I get it right: You upload an image and go right away to "recent files" view, after that you try to process the file and it logs that error? Because it seems, that tesseract does not find any image in the input.. |
Hi @janis91 yes, that is exactly the way to reproduce it.
|
Well, actually, I really cannot reproduce it. For me it seems like, the actual file is not given to tesseract to do the ocr job, but for me everything works out really well on newest version.. I'm not sure, if this could be a timing issue. The other option is the following: when you are in your file browser, upload the document that fails into a new clean folder. OCA.Files.fileActions.registerAction({
actionHandler: (_something, context) => {
console.log(context.fileInfoModel.attributes);
},
altText: 'Test',
displayName: 'Test',
iconClass: 'icon-help',
mime: 'image',
name: 'Test',
order: 100,
permissions: OC.PERMISSION_UPDATE
}) |
Thx for your time investingating this. So I tried to Repro this. First I created a new folder via the WebUi. Then I pasted your snippet into console and had to allow the paste (never did this, interesting concept). After that i uploaded a file via drag'n'drop to that folder in the browser
**Edit: ** /edit Then i thought, lets do a more real life scenario. When it fails for me, i usually had uploaded the file via the android client (instant upload). So i deleted the new folder. Created a new folder on my laptop, had it be synced up. Refreshed Nextcloud, went to recent files view. Pasted your snippet in the console, and ran the "test" Function on the file from recent file view. Output below. Then i tried to OCR that file and it failed.
Apparently i do not see any difference, do you? By the way, i think this was the console output when it failed:
I'll have another run, if you need to add further code to your snippet that reveals more details. |
I think so, too. Could you maybe try this: OCA.Files.fileActions.registerAction({
actionHandler: (_something, context) => {
const file = context.fileInfoModel.attributes;
console.log(file);
const downloadUrl = OCA.Files.App.fileList.getDownloadUrl(file.name);
console.log(downloadUrl);
fetch(downloadUrl).then((resp) => {
console.log(resp);
}).catch(console.log);
},
altText: 'Test',
displayName: 'Test',
iconClass: 'icon-help',
mime: 'image',
name: 'Test',
order: 100,
permissions: OC.PERMISSION_UPDATE
}) And maybe you could also try to copy the |
So
It says
When i navigate to
I get a 404. Then I went to "..." -> view in folder, used the "test" context menu and got this link in the console
When i paste this relative path behind my FQDN, I am offered to save the file. So yes, I would guess that the path generated is not correct, hence OCR cant find the file and will not work. Still funny... because when I then go back to recent files view, the correct path is printed into the console. So this is inline with my observation before. |
I think so to. I will try that in a more advanced scenario on my testing machine and hope that I can reproduce it by myself. If so, that might be a bug in the |
great! Thanks! Let me know when you need anything from me, i'm happy to help to resolve this! |
Version: 4.4.16
Bug report
Expected Behavior
OCR conversion takes the same time and works the same, no matter from where it is used
Current Behavior
When using OCR Tool from the "..." Menu on files in the Recent File view, it takes forever (>3min; i doubt it would ever finish tbh) to complete.
When using the "..." menu on a file and clicking "View in folder", the folder with the respective file opens.
When then using the OCR tool from the "..." Menu on the same file it completes within ~20 seconds.
Your Environment
The text was updated successfully, but these errors were encountered: