Sicos1977 / TesseractOCR

A .net library to work with Google's Tesseract
161 stars 20 forks source link

Separate NuGet package for native libraries #35

Closed vsolominov closed 1 year ago

vsolominov commented 1 year ago

How do you look at separating the main and independent solution (Core) from the dependencies needed for a particular system during the execution of the program (Runtime)?

For example, for Windows OS, make a separate NuGet package TesseractOCR.Windows (or TesseractOCR.runtime.win), and for Linux OS, make TesseractOCR.Linux (or TesseractOCR.runtime.linux). Although, most likely, for Linux it is better to detail the system version (debian, alpine, ubuntu...).

Sicos1977 commented 1 year ago

Isn't that a lot of work? Because you probably also need to add native compiled version of tesseract to the diferent nuget packages.

The current package is now build in a way that it should run on every system like Windows, Linux and macOS

vsolominov commented 1 year ago

The problem with the current native libraries is that they are compiled under Windows and simple renaming (for example, for Linux - lib...dll.so) does not solve the problem. You have to compile the libraries of the required OS, or download them from the repository. But the repository (especially the official one) does not always have up-to-date versions of native libraries. Or it happens that the version of Leptonica is 1.80, and the version of Tesseract is 5.3, but the wrapper (in C #) has already been adjusted for versions 1.83 and 5.3.

Sicos1977 commented 1 year ago

I'm open for suggestions and pull request about how to split the package. The only problem is that I don't have a Linux or MacOS system where I can compile Tesseract en Leptonica to the native versions that they need.

The only "Linux" system that I have is the subsystem that is in Windows 11 where you can run bash scripts and things like that.

gustavogmoraes commented 1 year ago

The problem with the current native libraries is that they are compiled under Windows and simple renaming (for example, for Linux - lib...dll.so) does not solve the problem. You have to compile the libraries of the required OS, or download them from the repository. But the repository (especially the official one) does not always have up-to-date versions of native libraries. Or it happens that the version of Leptonica is 1.80, and the version of Tesseract is 5.3, but the wrapper (in C #) has already been adjusted for versions 1.83 and 5.3.

Exact same problem here mate, wanna share knowledge or pair to solve it?