Fix issue #20 - fails on uppercase .PDF
This commit is contained in:
@@ -9,9 +9,15 @@ build/
|
||||
dist/
|
||||
*.egg-info/
|
||||
venv/
|
||||
venv-3.4/
|
||||
venv-3.5/
|
||||
*/test/output
|
||||
bin/
|
||||
include/
|
||||
lib/
|
||||
pip-selfcheck.json
|
||||
pyvenv.cfg
|
||||
htmlcov/
|
||||
.coverage
|
||||
.cache/
|
||||
.ipynb_checkpoints/
|
||||
|
||||
+2
-3
@@ -341,9 +341,8 @@ def cleanup_working_files(*args):
|
||||
|
||||
@transform(
|
||||
input=options.input_file,
|
||||
filter=suffix('.pdf'),
|
||||
output='.repaired.pdf',
|
||||
output_dir=work_folder,
|
||||
filter=formatter('(?i)\.pdf'),
|
||||
output=work_folder + '{basename[0]}.repaired.pdf',
|
||||
extras=[_log, _pdfinfo, _pdfinfo_lock])
|
||||
def repair_pdf(
|
||||
input_file,
|
||||
|
||||
@@ -328,3 +328,12 @@ def test_missing_docinfo():
|
||||
'missing_docinfo.pdf', 'missing_docinfo.pdf', '-l', 'eng', '-c')
|
||||
assert p.returncode == ExitCode.ok, err
|
||||
|
||||
|
||||
def test_uppercase_extension():
|
||||
shutil.copy(_make_input("skew.pdf"), _make_input("UPPERCASE.PDF"))
|
||||
try:
|
||||
check_ocrmypdf("UPPERCASE.PDF", "UPPERCASE_OUT.PDF")
|
||||
finally:
|
||||
os.unlink(_make_input("UPPERCASE.PDF"))
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user