MohrJonas / obsidian-ocr

Obsidian OCR allows you to search for text in your images and pdfs
GNU General Public License v3.0
281 stars 5 forks source link

Added a Queue Processor and Max Process setting #10

Closed evilgeniuschronicles closed 2 years ago

evilgeniuschronicles commented 2 years ago

I am also on Linux and experienced [#6 ] in a big way. Enabling this plugin made my laptop unresponsive for an hour as hundreds of tesseract processes started simultaneously. Here is how I tackled that:

This has been tested on Linux and I can test on MacOS as well. I'm hoping it works on Windows but I don't know one way or another. I tried to do things as closely in style as the existing code as I am capable of but feel free to refactor if you prefer something different. I set up OCRQueue with everything as static members of the class so that it is a singleton. I originally instantiated it as an object but that was kind of a drag so I changed it to this to be roughly analogous to how you are using the SettingsManager.

If you don't use my code, please use something along this lines. I will say this changed the plugin from a problem to wonderful on my Linux machine. This puts back the one Evernote feature that I really miss.