优化二维码日志
This commit is contained in:
@@ -75,7 +75,7 @@ def request_ie_result(task_enum, phrecs):
|
||||
|
||||
|
||||
# 尝试从二维码中获取高清图片
|
||||
def get_better_image_from_qrcode(image, dpi=150):
|
||||
def get_better_image_from_qrcode(image, image_id, dpi=150):
|
||||
js_base_url = 'http://einvoice.jsczt.cn'
|
||||
try:
|
||||
results = zxingcpp.read_barcodes(image)
|
||||
@@ -107,7 +107,7 @@ def get_better_image_from_qrcode(image, dpi=150):
|
||||
img = cv2.cvtColor(img, cv2.COLOR_RGB2BGR)
|
||||
return img, page.get_text()
|
||||
else:
|
||||
logging.getLogger('qr').info(f'未知二维码内容:{url}')
|
||||
logging.getLogger('qr').info(f'[{image_id}]中有未知二维码内容:{url}')
|
||||
except Exception as e:
|
||||
logging.getLogger('error').error('从二维码中获取高清图片时出错', exc_info=e)
|
||||
continue
|
||||
@@ -130,7 +130,7 @@ def information_extraction(ie, phrecs, identity):
|
||||
image = image_util.read(img_path)
|
||||
|
||||
# 尝试从二维码中获取高清图片
|
||||
better_image, text = get_better_image_from_qrcode(image)
|
||||
better_image, text = get_better_image_from_qrcode(image, phrec.cfjaddress)
|
||||
zx_ie_results = []
|
||||
if better_image is not None:
|
||||
img_angle = '0'
|
||||
|
||||
Reference in New Issue
Block a user