Unverified Commit cd061088 authored by Marius Göcke's avatar Marius Göcke
Browse files

fixes

parent fa3631db
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@ namespace SimpleOCR.CLI.Core.Helper

        private void Log()
        {
            _Log.Log($"Starting {this.RunBase.GetType().Name}...");
            _Log.Log($"Starting {this.RunBase.GetType().Name}...",Microsoft.Extensions.Logging.LogLevel.Debug);
        }
    }
}
+3 −3
Original line number Diff line number Diff line
@@ -24,14 +24,14 @@ namespace SimpleOCR.CLI.Core.Runner
            ocrService.Initialize();
            (FileType fileType, byte[] content, string mimeType) = SimpleOCR.Library.Core.Misc.Utilities.LoadFile(_Options.File);
            string result = ocrService.GetOCRContent(content, mimeType, new HashSet<string>(this._Options.Languages));
            if(this._Options.Outputfile == null)
            if(this._Options.OutputFile == null)
            {
                Console.WriteLine(result);
            }
            else
            {
                GRYLibrary.Core.Misc.Utilities.EnsureFileExists(this._Options.Outputfile);
                File.WriteAllText(this._Options.Outputfile, result, new UTF8Encoding(false));
                GRYLibrary.Core.Misc.Utilities.EnsureFileExists(this._Options.OutputFile);
                File.WriteAllText(this._Options.OutputFile, result, new UTF8Encoding(false));
            }
            return result;
        }
+2 −2
Original line number Diff line number Diff line
@@ -12,8 +12,8 @@ namespace SimpleOCR.CLI.Core.Verbs

        [Option('d', nameof(OCRDataFolder), Required = false, HelpText = "Folder where SimpleOCR is allowed to download data to and read data from.")]
        public string OCRDataFolder { get; set; }
        [Option('o', nameof(Outputfile), Required = false, HelpText = "Output-file for OCR-content. (OCR-content will be printed to console if output-file is not set.)")]
        public string Outputfile { get; set; }
        [Option('o', nameof(OutputFile), Required = false, HelpText = "Output-file for OCR-content. (OCR-content will be printed to console if output-file is not set.)")]
        public string OutputFile { get; set; }
        [Option('l', "Languages", HelpText = "Expected languages of the document-content in ISO 639-3 format", Default = "eng")]
        public IEnumerable<string> Languages { get; set; }

+1 −1
Original line number Diff line number Diff line
@@ -70,7 +70,7 @@ namespace SimpleOCR.Library.Core
            {
                string tessdataFolder = this._Configuration.DataFolder;
                GRYLibrary.Core.Misc.Utilities.AssertCondition(!string.IsNullOrEmpty(tessdataFolder), "No OCR-data-folder set.");
                this._Log.Log($"OCRFolder: {tessdataFolder}");
                this._Log.Log($"OCRFolder: {tessdataFolder}",Microsoft.Extensions.Logging.LogLevel.Debug);
                if (!this.IsInitialized)
                {
                    var traineddataFiles = Directory.GetFiles(this._Configuration.DataFolder).Where(file => file.EndsWith(".traineddata"));