From 8d34638f36fbd37fcf3c69343646fbf7c1cf2d6e Mon Sep 17 00:00:00 2001 From: gb <741021719@qq.com> Date: Fri, 18 Aug 2023 13:57:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=81=A2=E5=A4=8D=E5=9B=BE=E5=83=8F=E5=A4=84?= =?UTF-8?q?=E7=90=86=E5=AF=B9=E8=B1=A1=E9=9C=80=E8=A6=81=E6=89=8D=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD=E6=9C=BA=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hgdriver/hgdev/hg_scanner.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/hgdriver/hgdev/hg_scanner.cpp b/hgdriver/hgdev/hg_scanner.cpp index 12b6b8b..b39e982 100644 --- a/hgdriver/hgdev/hg_scanner.cpp +++ b/hgdriver/hgdev/hg_scanner.cpp @@ -234,7 +234,7 @@ hg_scanner::hg_scanner(ScannerSerial serial, const char* dev_name, usb_io* io, i thread_devslock_handle_.reset(new std::thread(&hg_scanner::thread_devslock_handle, this)); #endif - ImagePrc_pHandle_ = hg_imgproc::init(pid_, isx86_Advan_); + ImagePrc_pHandle_ = nullptr; // hg_imgproc::init(pid_, isx86_Advan_);; } hg_scanner::~hg_scanner() { @@ -1077,7 +1077,7 @@ void hg_scanner::thread_handle_image_process(void) { if (!ImagePrc_pHandle_) { - //ImagePrc_pHandle_ = hg_imgproc::init(pid_, isx86_Advan_); + ImagePrc_pHandle_ = hg_imgproc::init(pid_, isx86_Advan_); if (!ImagePrc_pHandle_) { VLOG_MINI_1(LOG_LEVEL_FATAL, "[thread_handle_image_process]:Get Image Process is NULL pid is %d.\n", pid_); @@ -2283,8 +2283,10 @@ int hg_scanner::setting_text_direction(void* data, long* len) if (!exact) strcpy((char*)data, str.c_str()); - if (image_prc_param_.bits.text_direction == TEXT_DIRECTION_AUTO && ImagePrc_pHandle_) + if (image_prc_param_.bits.text_direction == TEXT_DIRECTION_AUTO /*&& ImagePrc_pHandle_*/) { + if (!ImagePrc_pHandle_) + ImagePrc_pHandle_ = hg_imgproc::init(pid_, isx86_Advan_); hg_imgproc::init_auto_txt_hanld(ImagePrc_pHandle_); } else if (image_prc_param_.bits.text_direction != TEXT_DIRECTION_AUTO && ImagePrc_pHandle_)