-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
implemented ocr tool using tesseract #1239
Conversation
@enoy19 Can you update the CI to include the proper dependencies? |
Thanks, ill get the rpm's and deb's updated. Hopefully tesseract is available in homebrew for MacOs and easily available on windows or we will need to rethink how to package it. |
Thank you! |
#include "tesseract_tool.h" | ||
#include "src/utils/screenshotsaver.h" | ||
#include <QPainter> | ||
#include <tesseract/basetesseractApi.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where does this header come from? Per the tesseract docs it should be baseapi.h: https://github.com/tesseract-ocr/tesseract/blob/master/include/tesseract/baseapi.h
Having an issue building this on arch which lead me down this trail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it work by replacing the header with baseapi.h
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it work by replacing the header with
baseapi.h
?
Yes this works
src/tools/ocr/ocrtool.cpp
Outdated
return; | ||
} | ||
|
||
Pix *image = TesseractTool::qImage2PIX(context.selectedScreenshotArea().toImage()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
building this on Manjaro fails with the following error:
./flameshot/src/tools/ocr/ocrtool.cpp:71:33: error: ‘qImage2PIX’ is not a member of ‘TesseractTool’
71 | Pix *image = TesseractTool::qImage2PIX(context.selectedScreenshotArea().toImage());
| ^~~~~~~~~~
make[2]: *** [src/CMakeFiles/flameshot.dir/build.make:1222: src/CMakeFiles/flameshot.dir/tools/ocr/ocrtool.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:404: src/CMakeFiles/flameshot.dir/all] Error 2
make: *** [Makefile:171: all] Error 2
qImage2PIX != qImagetoPIX :)
calling wrong function in tesseract_tool.h
Hello all, It seems this PR is blocked / not merged. What would be the next steps to make this PR released ? If I understand, the current issue is to make this branch compile properly on Manjaro ? |
It must pass all the CI checks. It did not build properly on most platforms |
I've spent time to adapt @enoy19's commit to the newer codebase, which was building fine on Linux and I've even had an idea, how to manage languages but accidentally I'm gonna try it again but I have very little C++ and basically non existing Qt skills, e.g. it'll take time 😅 |
@xeaon damit. I wait for this feature and it looks like you fixed it then lost it. I had this problem in one of my projects and this made me feel bad :/ Anyway. I cannot do a lot by myself without investing a lot in cpp and qt stack. I am a python / js dev with very few knowledge aroud this project's stack. I will continue to live without this "nice to have" feature at the moment I guess. Thank you all for your reactivity and answers. |
Would be great to have this in the release, I hope someone with the needed skills will finish it! |
No description provided.