Coder Social home page Coder Social logo

Comments (9)

Balearica avatar Balearica commented on July 24, 2024

Do you have reason to believe that this issue is specific to IBM i, or is that simply extra context? Can you provide an example repo (or standalone flie) that is sufficient to reproduce this error? As await createWorker("eng") should run, the snippet above is not enough to go off of.

On a completely unrelated note, it is generally inadvisable to create new workers within the function that runs recognition within real applications. The reason is that, in addition to creating overhead every time the function is run, there is no limit to the number of workers that can end up being created. As a result, you either end up running 1 recognition job at a time to be safe (which is slow), or allowing for an unlimited number of jobs to run at the same time, which can crash your application.

The recommended approach is to create a scheduler. This allows you to define a fixed number of workers (say, 4) that persist between jobs, and use them to run recognition in parallel. See this guide for an explanation.

from tesseract.js.

gregorysababady avatar gregorysababady commented on July 24, 2024

Repository
https://github.com/gregorysababady/filereader

I already tried it on a windows server and it works just fine.

Thanks for the advise, yeah I definitely need to correct this out !

from tesseract.js.

Balearica avatar Balearica commented on July 24, 2024

Several of the dependencies in your repo's package.json don't install on Linux. Regardless, a more minimal example would be more useful for determining if there is a platform-specific issue with IBM i machines. Can you try running the basic example from the README on your system?

import { createWorker } from 'tesseract.js';

(async () => {
  const worker = await createWorker('eng');
  const ret = await worker.recognize('https://tesseract.projectnaptha.com/img/eng_bw.png');
  console.log(ret.data.text);
  await worker.terminate();
})();

If the issue is with createWorker not being able to run on this platform, then this basic example code should fail. If it runs properly, then I think the issue is something else in your codebase. Note that the function path.resolve is not actually used in this repo (outside of example scripts and build code), so it is unclear to me how your code could be failing at the createWorker step with this error message.

from tesseract.js.

gregorysababady avatar gregorysababady commented on July 24, 2024

This not working either, getting same path.resolve error.

On windows it works just fine.

The issue is coming from tesseract.js-core packages:
Issue_capture

from tesseract.js.

Balearica avatar Balearica commented on July 24, 2024

Thanks for confirming. Unless there is something particular about your settings, it sounds like there is indeed some platform-specific issue with IBM i.

It looks like the code in question is not originally from either the Tesseract.js or Tesseract.js-core repos, but rather is code that is added by Emscripten, which is the compiler used to go from C/C++ to webassembly.

https://github.com/emscripten-core/emscripten/blob/0c504193efb3d0b51d30c07895544b29cbad1950/src/library_path.js#L96-L100

I am currently not sure what is happening here. It appears to be something filesystem-related. Upon a brief search of the emscripten issues I did not see any references to IBM i.

from tesseract.js.

gregorysababady avatar gregorysababady commented on July 24, 2024

Ok so there's no solution to it ?

from tesseract.js.

gregorysababady avatar gregorysababady commented on July 24, 2024

So is there going to be a new patch soon ?

from tesseract.js.

Balearica avatar Balearica commented on July 24, 2024

It is likely that this can be fixed, however that would require troubleshooting by you or another IBM i user to figure out what the root cause is. I am not able to troubleshoot a platform-specific issue on a proprietary platform that I do not have access to.

from tesseract.js.

gregorysababady avatar gregorysababady commented on July 24, 2024

Thank you and by the way there is this pulbic server available to anyone https://pub400.com

You can create credentials and test the code directly there !

That's the same working environment as on my machine.

Thank you for your help, its much appreciated !

from tesseract.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.