From 7acd75f013830f8d170d7278743510db68bed0d7 Mon Sep 17 00:00:00 2001 From: "James R. Barlow" Date: Mon, 29 Oct 2018 22:26:37 -0700 Subject: [PATCH] pipeline: fix bbox coordinates --- src/ocrmypdf/_pipeline.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ocrmypdf/_pipeline.py b/src/ocrmypdf/_pipeline.py index eef05497..ff4e60dc 100644 --- a/src/ocrmypdf/_pipeline.py +++ b/src/ocrmypdf/_pipeline.py @@ -593,9 +593,9 @@ def select_ocr_image( bbox = textarea xscale, yscale = float(xres) / 72.0, float(yres) / 72.0 pixcoords = [bbox[0] * xscale, - im.height - bbox[1] * yscale, + im.height - bbox[3] * yscale, bbox[2] * xscale, - im.height - bbox[3] * yscale] + im.height - bbox[1] * yscale] pixcoords = [int(round(c)) for c in pixcoords] log.debug('blanking %r', pixcoords) draw.rectangle(pixcoords, fill=white)