From 21aad7d1b9290528fc73b5dc1d864993f7079f44 Mon Sep 17 00:00:00 2001 From: Axel Svensson Date: Sat, 15 Jun 2024 15:58:38 +0000 Subject: [PATCH] Fix regex in pdfGetSize --- pdf-sign | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pdf-sign b/pdf-sign index 259cb64..8fb07a9 100755 --- a/pdf-sign +++ b/pdf-sign @@ -671,10 +671,10 @@ def tkthrottle(frequency, root): return decorator def pdfCountPages(filePath): - return int(fromCmdOutput(["pdfinfo", filePath], "^.*\nPages: +([0-9]+)\n.*$")[1]) + return int(fromCmdOutput(["pdfinfo", filePath], r"^.*\nPages: +([0-9]+)\n.*$")[1]) def pdfGetSize(filePath): - [ignored, w, h, *ignored2]=fromCmdOutput(['pdfinfo', filePath], '^.*\nPage size: +([0-9.]+) x ([0-9.]+) pts( \([A-Za-z0-9]+\))?\n.*$') + [ignored, w, h, *ignored2]=fromCmdOutput(['pdfinfo', filePath], r'^.*\nPage size: +([0-9.]+) x ([0-9.]+) pts( \([A-Za-z0-9]+\))?\n.*$') return (float(w), float(h)) def m(pattern, string):