From 79e067188ec0fe7f6cccb7069ca2d2ba21199ad8 Mon Sep 17 00:00:00 2001 From: szopin Date: Fri, 16 Sep 2022 10:12:46 +0200 Subject: [PATCH] Fix for ocr import Currently works only for .pdf files, with this .png and .jpg should also work (fixes #512) --- misp_modules/modules/import_mod/ocr.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misp_modules/modules/import_mod/ocr.py b/misp_modules/modules/import_mod/ocr.py index fef0fd1..2e82cd2 100755 --- a/misp_modules/modules/import_mod/ocr.py +++ b/misp_modules/modules/import_mod/ocr.py @@ -67,7 +67,7 @@ def handler(q=False): image = img.make_blob('png') log.debug("Final image size is {}x{}".format(pdf.width, pdf.height * (p + 1))) else: - image = document + image = base64.b64decode(request["data"]) image_file = BytesIO(image) image_file.seek(0)