mirror of
https://github.com/scito/extract_otp_secret_keys.git
synced 2025-12-15 19:16:42 +01:00
catch zbar import error
This commit is contained in:
parent
05db190de3
commit
4612ab6e7f
3 changed files with 8 additions and 5 deletions
|
|
@ -187,7 +187,10 @@ def convert_img_to_line(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
|
||||
try:
|
||||
from qreader import QReader
|
||||
except ImportError as e:
|
||||
abort('\nERROR: Cannot import QReader module probably due to missing zbar shared library. Exception:\n{}'.format(str(e)))
|
||||
|
||||
decoder = QReader()
|
||||
decoded_text = decoder.detect_and_decode(image=image)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue