From 7d2009ccefbfe9fcfea096f62c564ce99ca69ce9 Mon Sep 17 00:00:00 2001 From: "James R. Barlow" Date: Thu, 27 Oct 2016 15:36:20 -0700 Subject: [PATCH] ghostscript: log errors from stdout --- ocrmypdf/ghostscript.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocrmypdf/ghostscript.py b/ocrmypdf/ghostscript.py index 0e3200d1..39640c77 100644 --- a/ocrmypdf/ghostscript.py +++ b/ocrmypdf/ghostscript.py @@ -29,7 +29,10 @@ def rasterize_pdf(input_file, output_file, xres, yres, raster_device, log, universal_newlines=True) stdout, stderr = p.communicate() if stdout: - log.debug(stdout) + if 'error' in stdout: + log.error(stdout) # Ghostscript puts errors in stdout + else: + log.debug(stdout) if stderr: log.error(stderr)