nguyenq / tess4j

Java JNA wrapper for Tesseract OCR API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DLL Extracting on linux even when using custom libs path and not utilizing LoadLibs.extractTessResources()

dreamwraith opened this issue · comments

Is there any way to prevent the described behavior?

I have coded in my application to not utilize LoadLibs.extractTessResources() when I am running on a particular platform (linux based), and instead I pass the library location.

However, no matter what I do, as soon as I instantiate an instance of Tesseract1() the dll files are extracted. This results in it repeating the extraction every time the class is instantiated as well, significantly slowing down performance when it is not needed.

Can the class instantiation be made to not extract the DLL files unless LoadLibs.extractTessResources() is called?

You're right. Windows DLLs should not be extracted when the program is run on Linux or non-Windows platforms. The resource loading is defined in LoadLibs class. Can you submit a PR?

You're right. Windows DLLs should not be extracted when the program is run on Linux or non-Windows platforms. The resource loading is defined in LoadLibs class. Can you submit a PR?

I will take a look when I am back at work this week and see what I can muster up. Thanks.

@dreamwraith I checked in a fix for this issue. Please verify. Thanks.

@nguyenq Apologies, checking in on this - I have not yet been able to get back to testing this due to competing priorities. Should be able to validate sometime next month.

@nguyenq this change seemed to have worked for me. Thanks!