From 79058e1a807e7b9f2ea39c097ac6b44b48436090 Mon Sep 17 00:00:00 2001 From: Ben Olden-Cooligan Date: Wed, 6 Dec 2023 19:44:36 -0800 Subject: [PATCH] Fix error with Legacy OCR mode #210 --- NAPS2.Lib/EtoForms/Ui/OcrSetupForm.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/NAPS2.Lib/EtoForms/Ui/OcrSetupForm.cs b/NAPS2.Lib/EtoForms/Ui/OcrSetupForm.cs index bb59929556..1c0603a556 100644 --- a/NAPS2.Lib/EtoForms/Ui/OcrSetupForm.cs +++ b/NAPS2.Lib/EtoForms/Ui/OcrSetupForm.cs @@ -24,10 +24,17 @@ public OcrSetupForm(Naps2Config config, TesseractLanguageManager tesseractLangua LoadLanguages(); + var configOcrMode = Config.Get(c => c.OcrMode); + if (configOcrMode == LocalizedOcrMode.Legacy) + { + // Legacy is no longer supported + configOcrMode = LocalizedOcrMode.Fast; + } + _enableOcr.Checked = Config.Get(c => c.EnableOcr); _ocrLang.SelectedKey = Config.Get(c => c.OcrLanguageCode) ?? ""; if (_ocrLang.SelectedIndex == -1) _ocrLang.SelectedIndex = 0; - _ocrMode.SelectedIndex = (int) Config.Get(c => c.OcrMode); + _ocrMode.SelectedIndex = (int) configOcrMode; if (_ocrMode.SelectedIndex == -1) _ocrMode.SelectedIndex = 0; _ocrAfterScanning.Checked = Config.Get(c => c.OcrAfterScanning);