Fix issue #20 - fails on uppercase .PDF

This commit is contained in:
James R. Barlow
2015-12-04 02:14:09 -08:00
parent 78697341a2
commit acb31abe86
3 changed files with 17 additions and 3 deletions
+6
View File
@@ -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
View File
@@ -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,
+9
View 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"))