From d787e1ea0fcbac6aae645b22af7c244b0c7bfd22 Mon Sep 17 00:00:00 2001 From: "James R. Barlow" Date: Tue, 1 May 2018 22:59:22 -0700 Subject: [PATCH] ghostscript.py not saved in last commit Given importance of last one, confirmed that when the file is saved all tests pass too. Passing is invariant with this change. --- src/ocrmypdf/exec/ghostscript.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/ocrmypdf/exec/ghostscript.py b/src/ocrmypdf/exec/ghostscript.py index 8f64d4c1..97a98d68 100644 --- a/src/ocrmypdf/exec/ghostscript.py +++ b/src/ocrmypdf/exec/ghostscript.py @@ -122,14 +122,14 @@ def rasterize_pdf(input_file, output_file, xres, yres, raster_device, log, log.debug("Rotating output by %i", rotation) # rotation is a clockwise angle and Image.ROTATE_* is # counterclockwise so this cancels out the rotation - # if rotation == 90: - # im = im.transpose(Image.ROTATE_90) - # elif rotation == 180: - # im = im.transpose(Image.ROTATE_180) - # elif rotation == 270: - # im = im.transpose(Image.ROTATE_270) - # if rotation % 180 == 90: - # page_dpi = page_dpi[1], page_dpi[0] + if rotation == 90: + im = im.transpose(Image.ROTATE_90) + elif rotation == 180: + im = im.transpose(Image.ROTATE_180) + elif rotation == 270: + im = im.transpose(Image.ROTATE_270) + if rotation % 180 == 90: + page_dpi = page_dpi[1], page_dpi[0] im.save(fspath(output_file), dpi=page_dpi)