mirror of
https://github.com/scito/extract_otp_secrets.git
synced 2025-12-16 23:30:48 +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 json
|
||||
from cv2 import imread, imdecode, IMREAD_UNCHANGED
|
||||
from qreader import QReader
|
||||
from urllib.parse import parse_qs, urlencode, urlparse, quote
|
||||
from os import path, makedirs
|
||||
from re import compile as rcompile
|
||||
@@ -180,6 +179,9 @@ def get_lines_from_file(filename):
|
||||
if image is None:
|
||||
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()
|
||||
decoded_text = decoder.detect_and_decode(image=image)
|
||||
if decoded_text is None:
|
||||
|
||||
Reference in New Issue
Block a user