diff --git a/ARKBreedingStats/Properties/AssemblyInfo.cs b/ARKBreedingStats/Properties/AssemblyInfo.cs index 951f2680..f8af0f46 100644 --- a/ARKBreedingStats/Properties/AssemblyInfo.cs +++ b/ARKBreedingStats/Properties/AssemblyInfo.cs @@ -30,6 +30,6 @@ // Revision // [assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("0.43.0.2")] +[assembly: AssemblyFileVersion("0.43.0.3")] [assembly: NeutralResourcesLanguage("en")] diff --git a/ARKBreedingStats/ocr/OCRControl.cs b/ARKBreedingStats/ocr/OCRControl.cs index 885f2802..0239000a 100644 --- a/ARKBreedingStats/ocr/OCRControl.cs +++ b/ARKBreedingStats/ocr/OCRControl.cs @@ -34,7 +34,8 @@ public OCRControl() public void Initialize() { SetWhiteThreshold(Properties.Settings.Default.OCRWhiteThreshold); - LoadAndInitializeOcrTemplate(Properties.Settings.Default.ocrFile); + if (!LoadAndInitializeOcrTemplate(Properties.Settings.Default.ocrFile)) + Properties.Settings.Default.ocrFile = null; } private void InitLabelEntries() @@ -449,8 +450,16 @@ private bool LoadAndInitializeOcrTemplate(string filePath) return false; } - ArkOCR.OCR.ocrConfig = OCRTemplate.LoadFile(filePath) ?? new OCRTemplate(); + var loadedOcrConfig = OCRTemplate.LoadFile(filePath); + if (loadedOcrConfig == null) + { + filePath = null; + } + + ArkOCR.OCR.ocrConfig = loadedOcrConfig; UpdateOCRLabel(filePath); + if (loadedOcrConfig == null) return false; + UpdateOcrFontSizes(); InitLabelEntries(); nudResizing.Value = ArkOCR.OCR.ocrConfig.resize == 0 ? 1 : (decimal)ArkOCR.OCR.ocrConfig.resize;