From 549f32547d474d7d3a33651cf5dc8d9ce8a8720b Mon Sep 17 00:00:00 2001 From: Steve Clement Date: Sun, 1 Jul 2018 22:08:42 +0800 Subject: [PATCH] - Reverted to <3.6 compatibility --- misp_modules/modules/import_mod/ocr.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/misp_modules/modules/import_mod/ocr.py b/misp_modules/modules/import_mod/ocr.py index 15d660b..f14212b 100755 --- a/misp_modules/modules/import_mod/ocr.py +++ b/misp_modules/modules/import_mod/ocr.py @@ -56,16 +56,16 @@ def handler(q=False): with document as pdf: # Get number of pages pages=len(pdf.sequence) - log.debug(f"PDF with {pages} page(s) detected") + log.debug("PDF with {} page(s) detected".format(pages)) # Create new image object where the height will be the number of pages. With huge PDFs this will overflow, break, consume silly memory etc… img = WImage(width=pdf.width, height=pdf.height * pages) # Cycle through pages and stitch it together to one big file for p in range(pages): - log.debug(f"Stitching page {p+1}") + log.debug("Stitching page {}".format(p+1)) image = img.composite(pdf.sequence[p], top=pdf.height * p, left=0) # Create a png blob image = img.make_blob('png') - log.debug(f"Final image size is {pdf.width}x{pdf.height*(p+1)}") + log.debug("Final image size is {}x{}".format(pdf.width, pdf.height*(p+1))) else: image = document