summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ocrloader.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/ocrloader.py b/ocrloader.py
index b34ebc4..5556304 100644
--- a/ocrloader.py
+++ b/ocrloader.py
@@ -41,8 +41,10 @@ def process(cfg, filename, payload, enable_ocr=True):
os.write(fd, payload)
os.close(fd)
print >> sys.stderr, ' running OCR on file'
- os.system('abbyyocr9 -rl French -if %s -f PDF -pem ImageOnText -pfpr 150 -pfq 100 -of %s' % \
- (tmpfilename, ocr_filename))
+ subprocess.call(['/opt/ABBYYOCR9/abbyyocr9',
+ '-rl', 'French', '-if', tmpfilename,
+ '-f', 'PDF', '-pem', 'ImageOnText', '-pfpr', '150',
+ '-pfq', '100', '-of', ocr_filename])
if not os.path.exists(ocr_filename):
print >> sys.stderr, 'failed to OCR %s' % filename
file('/tmp/' + filename, 'w').write(payload) # keep it for inspection