mirror of
https://github.com/scito/extract_otp_secrets.git
synced 2025-12-19 16:50:34 +01:00
dynamic import of QReader
since this module has a dependency to zbar lib
This commit is contained in:
@@ -49,7 +49,6 @@ import sys
|
|||||||
import csv
|
import csv
|
||||||
import json
|
import json
|
||||||
from cv2 import imread, imdecode, IMREAD_UNCHANGED
|
from cv2 import imread, imdecode, IMREAD_UNCHANGED
|
||||||
from qreader import QReader
|
|
||||||
from urllib.parse import parse_qs, urlencode, urlparse, quote
|
from urllib.parse import parse_qs, urlencode, urlparse, quote
|
||||||
from os import path, makedirs
|
from os import path, makedirs
|
||||||
from re import compile as rcompile
|
from re import compile as rcompile
|
||||||
@@ -180,6 +179,9 @@ def get_lines_from_file(filename):
|
|||||||
if image is None:
|
if image is None:
|
||||||
abort('\nERROR: Unable to open file for reading.\ninput file: {}'.format(filename))
|
abort('\nERROR: Unable to open file for reading.\ninput file: {}'.format(filename))
|
||||||
|
|
||||||
|
# dynamic import of QReader since this module has a dependency to zbar lib
|
||||||
|
from qreader import QReader
|
||||||
|
|
||||||
decoder = QReader()
|
decoder = QReader()
|
||||||
decoded_text = decoder.detect_and_decode(image=image)
|
decoded_text = decoder.detect_and_decode(image=image)
|
||||||
if decoded_text is None:
|
if decoded_text is None:
|
||||||
|
|||||||
Reference in New Issue
Block a user