OCR: Multiple languages, separate language setting, and bulk reprocessing

(The text below was generated by AI, since I'm not an native English speaker, but upon my detailed request and then it was manually checked and edited by me).

Hi everyone,

First of all, I would like to thank the developers and contributors for this excellent application.

Following another Evernote price increase, I have been actively looking for an alternative, and I have been pleasantly surprised by Joplin’s features and overall quality.

However, I have encountered a limitation in the current OCR implementation - or perhaps I am missing an existing configuration option.

I have many notes containing PDFs and images whose contents I would like to be able to find using search. These documents may be written in different languages. In my case, the most common languages are Polish, English, and Russian.

As far as I understand, Joplin currently selects the OCR language based on the application’s UI language. It would be useful to separate these settings so that the OCR language could be selected independently of the interface language.

I tested this with the same collection of attachments:

  • With the Joplin interface set to Russian, Russian documents were recognized well, but Polish and English documents were not recognized meaningfully.

  • With the interface set to Polish, Polish and English documents were recognized, but Russian documents were not.

Ideally, the OCR settings would allow users to select multiple languages - for example, pol+eng+rus. As far as I know, Tesseract supports loading multiple language models, although I understand that this may affect recognition speed and accuracy.

While experimenting with OCR, I noticed another related inconvenience. There does not seem to be a way to reprocess all existing attachments after changing the OCR language or other OCR settings.

Disabling and re-enabling OCR does not schedule already processed resources again. Clearing and re-downloading the language-data cache also does not reset their OCR status - which is understandable, since clearing the model cache and deleting recognition results are conceptually different operations.

It would therefore be useful to have a separate command such as:

Re-run OCR for all attachments

Ideally, it could also offer a choice between:

  • reprocessing all supported attachments;

  • reprocessing only attachments for which OCR previously failed;

  • reprocessing attachments in the selected note or notebook.

As a workaround, I closed Joplin and directly reset the ocr_status, ocr_text, ocr_details, and ocr_error fields in the resources table of the SQLite database. This successfully caused Joplin to process all 942 supported resources again, but editing the database directly is clearly not an appropriate solution for regular users.

Are there already supported ways to configure multiple OCR languages and to schedule bulk OCR reprocessing that I have overlooked?

If not, I would be very interested in seeing these capabilities added:

  1. An OCR language setting independent of the UI language.

  2. Support for selecting multiple OCR languages.

  3. A command to reset and re-run OCR for existing attachments.

Thank you again for developing and maintaining Joplin. I would be grateful for any advice or feedback.

I moved on, checked out the project, patched the worker creation line in packages\lib\services\ocr\drivers\OcrDriverTesseract.ts, so instead of language variable it passes the hardcoded array ['pol', 'rus', 'eng'], and then tried to add several images with text in all the languages: English, Polish, Russian, both separate or all the languages in the same image. With the patch the text was recognized correctly in all the languages. It means that it's possible to fix the Joplin code to provide multi-language OCR.

Now I can try to implement the needed changes in UI, so that the user would be able to override the OCR languages - and create a corresponding PR. But since this will take time, I would like to first make sure this is actually needed and my PR will be at least considered. I saw the topic here that PRs from new contributors are paused. Also no replies to this topic makes me doubt that anyone actually uses Joplin OCR for multiple alphabets. I'm going to just use my own patched version for now.