Skip to content

Commit

Permalink
Fix error with Legacy OCR mode
Browse files Browse the repository at this point in the history
  • Loading branch information
cyanfish committed Dec 7, 2023
1 parent 2596f8e commit 79058e1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion NAPS2.Lib/EtoForms/Ui/OcrSetupForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 79058e1

Please sign in to comment.