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

PixConverter Unavailable for NET CORE #477

Closed
Potmos opened this issue Jun 27, 2019 · 6 comments
Closed

PixConverter Unavailable for NET CORE #477

Potmos opened this issue Jun 27, 2019 · 6 comments

Comments

@Potmos
Copy link

Potmos commented Jun 27, 2019

The PixConverter and other related seems to not be available when I reference the latest version of the Tesseract package.
Is there any reason for it?

@ArXen42
Copy link

ArXen42 commented Aug 13, 2019

I suppose that caused by the fact that System.Drawing is not built into .NET Core standard library, so all the code related to bitmap is surrounded by #if NETFULL ... #endif.

However, System.Drawing is now accessible as a nuget package, so you can probably copy-paste all the neccessary methods and classes from sources into your project. Alternatively, it should probably be possible to add System.Drawing under .NET support here without too much effort and compile fixed version for yourself.

@ArXen42
Copy link

ArXen42 commented Aug 13, 2019

Actually, people have already done it.

@chucker
Copy link

chucker commented Aug 29, 2019

However, System.Drawing is now accessible as a nuget package

Note that the System.Drawing.Common package is called so because it's not the entire System.Drawing (for instance, ColorConverter is missing), so there may be some limitations.

@ArXen42
Copy link

ArXen42 commented Aug 29, 2019

As far as I understand, Bitmap, even if limited, is very useful as common representation of image. I guess most imaging libraries support conversion to/from bitmap.
For instance, one can do all image manipulation with OpenCV, then, at the final stage, convert image to Bitmap and pass it to tesseract.

At least that is probably better than doing conversion by saving image to temporary storage (memory or disk) and then loading it back using another library and much easier than writing complicated conversion code with direct memory access.

@tdhintz
Copy link
Contributor

tdhintz commented Aug 29, 2019 via email

charlesw added a commit that referenced this issue Oct 12, 2019
…ract.Drawing

Created a new package called Tesseract.Drawing to support integration with System.Drawing from .net core, or any other
target that supports .netstandard2 and the System.Drawing.Common package. This option was chosen so that core
Tesseract package doesn't include unnecessary dependencies which could cause issues on other platforms.
@charlesw
Copy link
Owner

charlesw commented Oct 12, 2019

FYI I've split of a new package Tesseract.Drawing, currently in beta, to support using Bitmaps in .net core if they are required. However I would agree with @tdhintz that just using pix should be preferred if possible (not sure why the results would be different though, odd).

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

No branches or pull requests

5 participants