Skip to content
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

Project settings : Record field alignment #22

Open
Ykurfeza opened this issue Jul 20, 2023 · 0 comments
Open

Project settings : Record field alignment #22

Ykurfeza opened this issue Jul 20, 2023 · 0 comments

Comments

@Ykurfeza
Copy link

First, thank you for the work put into TTesseractOCR4 for delphi, that helps a lot!
Actually working on Delphi 11.3.

I just discovered after some testing and debugging, that the record field alignement is important for the dll to work correctly.

For about a day I was trying to implement Tesseract into my project without success, using the same dlls and trained data files as your project examples, I wasn't able to make mine working (always crashing on the recognize call to the api with an adress error), but the example worked just fine with exactly the same data (images etc.).

After comparing the project settings, I found out that mine had the option "Record field alignment" (Project > Options > Delphi Compiler > Compiling > Code Generation Options) set to Bytes and that your example had it set to "Quad words".

This option cannot be change in my project, but putting the compiler directives {$A+}{$A8} at the beginning of the tesseractocr.capi file solved the issue for me even when keeping the options set to Bytes in delphi project.

Maybe it should be added by default in the source for it to work independently from the project settings? At least it's a good solution at the moment for me (maybe not the best).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant