From a45505cf1d014c1d5fcec0086c0fb6c60bf3c659 Mon Sep 17 00:00:00 2001 From: "James R. Barlow" Date: Thu, 23 Jun 2016 13:36:23 -0700 Subject: [PATCH] Fix order of operations in matrix multiplication Issue #73. The order of operations happens to not matter for scaling but does matter for translation. We only need scaling to find the DPI, so the error was not noticed. Mainly useful to other uses of this library. --- ocrmypdf/pageinfo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ocrmypdf/pageinfo.py b/ocrmypdf/pageinfo.py index 54d73d73..64fba79a 100644 --- a/ocrmypdf/pageinfo.py +++ b/ocrmypdf/pageinfo.py @@ -93,7 +93,7 @@ def _interpret_contents(contentstream): ctm = stack.pop() elif command == b'cm': ctm = matrix_mult( - ctm, _matrix_from_shorthand(operands)) + _matrix_from_shorthand(operands), ctm) elif command == b'Do': image_name = operands[0] image_raster_settings.append(