From bb505013697eea4b4c57272d533dbb1992977fb8 Mon Sep 17 00:00:00 2001 From: "James R. Barlow" Date: Fri, 3 Aug 2018 00:44:34 -0700 Subject: [PATCH] ghostscript: never use autorotatepages It looks like from the gs manual that this parameter is only respected for vector devices so it never had any effect, but to stay on the safe side, which it off. --- src/ocrmypdf/exec/ghostscript.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/ocrmypdf/exec/ghostscript.py b/src/ocrmypdf/exec/ghostscript.py index 14af626f..1e88648a 100644 --- a/src/ocrmypdf/exec/ghostscript.py +++ b/src/ocrmypdf/exec/ghostscript.py @@ -113,8 +113,6 @@ def rasterize_pdf(input_file, output_file, xres, yres, raster_device, log, if not page_dpi: page_dpi = res - autorotate = '/PageByPage' if rotation is None else '/None' - with NamedTemporaryFile(delete=True) as tmp: args_gs = [ 'gs', @@ -127,7 +125,7 @@ def rasterize_pdf(input_file, output_file, xres, yres, raster_device, log, '-dLastPage=%i' % pageno, '-r{0}x{1}'.format(str(int_res[0]), str(int_res[1])), '-o', tmp.name, - '-dAutoRotatePages=%s' % autorotate, + '-dAutoRotatePages=/None', # Probably has no effect on raster '-f', fspath(input_file) ]