Add warning if problematic --tesseract-pagesegmode is selected
Fixes #549
This commit is contained in:
@@ -276,6 +276,11 @@ def check_options_advanced(options):
|
||||
"Tesseract 4.0 ignores --user-words and --user-patterns, so these "
|
||||
"arguments have no effect."
|
||||
)
|
||||
if options.tesseract_pagesegmode in (0, 2):
|
||||
log.warning(
|
||||
"The --tesseract-pagesegmode argument you select will disable OCR. "
|
||||
"This may cause processing to fail."
|
||||
)
|
||||
|
||||
|
||||
def check_options_metadata(options):
|
||||
|
||||
@@ -210,3 +210,9 @@ def test_version_comparison():
|
||||
version_checker=lambda: '1.0',
|
||||
need_version='2.0',
|
||||
)
|
||||
|
||||
|
||||
def test_pagesegmode_warning(caplog):
|
||||
opts = make_opts(tesseract_pagesegmode='0')
|
||||
vd.check_options_advanced(opts)
|
||||
assert 'disable OCR' in caplog.text
|
||||
|
||||
Reference in New Issue
Block a user