tesseract
tesseract copied to clipboard
Add null check for executing assembly path
When compiling a .NET6 project in release mode with the PublishSingleFile option, the following code throws because Assembly.GetExecutingAssembly().Location => null (MS Docs).
https://github.com/charlesw/tesseract/blob/9b256cc03d7c9260311e9d90656146dd620e8e9a/src/Tesseract/Internal/InteropDotNet/LibraryLoader.cs#L77-L82
The root issue is GetExecutingAssembly I think; replace it with a call to something like typeof(TesseractEngine).Assembly still works
I've applied a workaround to our own Tesseract usage here - bit of a hack but seems to do the job for now, including compensating for dlopen having moved libraries on some recent Linux releases. https://github.com/SMI/IsIdentifiable/blob/main/IsIdentifiable/TesseractLinuxLoaderFix.cs
The previous fix 637342e has now been merged into master and was included in 5.2 release. Sorry for the delay!