-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Add ability to load language from a File (Blob/Stream etc) #794
Comments
The
|
Thanks that would be helpful. It will take me a few days until I go back to this project again but just to confirm, simply have the file exists there is all it needs? Does it detect all |
If you initialize Tesseract with language |
Closing as answered. |
Is your feature request related to a problem? Please describe.
Right now in order to load a language, the URL has to be specified at the beginning and it must be available already. This does not apply to Chrome extension (offline). Say I can download a user-selected file (they download when they are online) and store it in IndexedDB. Now I want to feed it to TesseractJs but currently this is impossible because the file does not really have an URL.
Describe the solution you'd like
The
loadLanguage
can accept an optional second parameter,content
where the content is provided, maybe through aBlob
,Stream
orArrayBuffer
. Alternatively, astring
orURL
object can be provided to override the default behavior (langPath
+langCode
+<magic string>
) to tell Tesseract to just download from that URL. I think another parameter to specify if it'sgzip
or not would be nice as well.Describe alternatives you've considered
Right now the only way to do it is to require users to be online and download the files from the server/a server.
Additional context
N/A
The text was updated successfully, but these errors were encountered: