tisfeng / Easydict

一个简洁优雅的词典翻译 macOS App。开箱即用,支持离线 OCR 识别,支持有道词典,🍎 苹果系统词典,🍎 苹果系统翻译,OpenAI,Gemini,DeepL,Google,Bing,腾讯,百度,阿里,小牛,彩云和火山翻译。A concise and elegant Dictionary and Translator macOS App for looking up words and translating text.
GNU General Public License v3.0
7.04k stars 356 forks source link

🚀 Feature Request: OCR areas history #461

Open thesla13 opened 6 months ago

thesla13 commented 6 months ago

Hey there!

Sometimes when using EasyDict I would OCR the same area of the screen over and over again. For instance, when looking up subtitles hardcoded into a video-file. So this means I have to select the same area by hand, over and over and over again, which does become tedious.

Now, some screenshot tools like Snipaste keep area history for cases when you make screenshots of the same area repeatedly. Snipaste, for instance, lets you press the 'R' key to reselect the last area shot, then, if need be, press 'R' again to select the one before that, and so on.

I do think that keeping a history of OCR'ed areas would be a nice quality-of-life improvement for EasyDict.

Thank you so much for your work!

tisfeng commented 6 months ago

Thanks for the suggestion, a similar request https://github.com/tisfeng/Easydict/issues/22 has been made before, but I didn't find this the right way to add this feature, so I've shelved it.

Previously my idea was to add an additional shortcut specifically for triggering the previous history screenshot area.

Snipaste, for instance, lets you press the 'R' key to reselect the last area shot, then, if need be, press 'R' again to select the one before that, and so on.

Now you give us another good suggestion, we will evaluate these two ways of implementation.

tisfeng commented 6 months ago

The previous screenshot OCR feature was implemented using a third-party objc library, and the code was quite messy, which may cause memory leakage issues.

Later, we plan to rewrite it using Swift, which may take some time. Please be patient.

If someone is familiar with the screenshot feature in Swift, we warmly welcome you to submit a PR!