Image-To-Text-OCR-extension-for-ChatGPT
Image-To-Text-OCR-extension-for-ChatGPT copied to clipboard
Changing the language to "chi_sim" will cause a warning
My content.js changed as follows:
const CONSTANTS = {
scriptId: "image-to-text-content-script",
workerLanguage: ["chi_sim"],
textareaId: "prompt-textarea",
uploadButtonID: "upload-button-image-to-text-extension",
uploadButtonBGColor: "#343640",
lightModeUploadButtonIcon: "images/upload-icon-dark.png",
darkModeUploadButtonIcon: "images/upload-icon-light.png",
defaultUploadButtonIcon: "images/upload-icon-default.png",
languageButtonIcon: "images/languages-icon.png",
flexBoxContainerId: "flexbox-container-image-to-text-extension",
};
A warning appears on the console:
What should I do, looking forward to your reply
Hello, thank you for posting this issue.
Just a quick background to help with the rest; this extension uses an OCR engine called Tesseract which is ported to JavaScript by https://github.com/naptha/tesseract.js
When trying to debug, its a question of which layer the issue is at, which could be at this extension's level, tesseract.js' level, or the engine itself.
I'm not 100% sure on exactly what the actual root cause is but I believe its very likely the following: Considering CHI is the only language the error occurs for, the default parameters the tesseract.js wrapper tries to apply for all languages is not supported for Chi. Those parameters are attempted to be applied but because they are not supported for CHI, the warning is issued.
Further evidence to support this is that the warnings are all of the nature that certain parameters being unable to be found.
The closest issue I found reflecting this was: https://github.com/naptha/tesseract.js/issues/728
Next steps: I also tested the extension with the warning and the outputs seem to still work as intended. If you had the chance or were able to verify, did the warnings seem to impact the output?
If there is no impacts, I think the issue can be closed, otherwise we can open an issue at https://github.com/naptha/tesseract.js to fully confirm.