fix up the ocrmypdf parameter construction for clean-final and redo

This commit is contained in:
jonaswinkler 2021-02-21 23:39:19 +01:00
parent a13e9f23b1
commit 265432f2a5

View File

@ -155,8 +155,11 @@ class RasterisedDocumentParser(DocumentParser):
if settings.OCR_CLEAN == 'clean':
ocrmypdf_args['clean'] = True
elif settings.OCR_CLEAN == 'clean-final' and not settings.OCR_MODE == 'redo': # NOQA: E501
ocrmypdf_args['clean_final'] = True
elif settings.OCR_CLEAN == 'clean-final':
if settings.OCR_MODE == 'redo':
ocrmypdf_args['clean'] = True
else:
ocrmypdf_args['clean_final'] = True
if settings.OCR_DESKEW and not settings.OCR_MODE == 'redo':
ocrmypdf_args['deskew'] = True