From b0db0015bb47e4b3dcac039e4aae3c3cc3cf74a7 Mon Sep 17 00:00:00 2001 From: luoliangyi <87842688@qq.com> Date: Wed, 2 Nov 2022 15:17:46 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=AE=8F=E5=AE=9A=E4=B9=89=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hgdriver/hgdev/image_process.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/hgdriver/hgdev/image_process.cpp b/hgdriver/hgdev/image_process.cpp index b356ca3..bab1293 100644 --- a/hgdriver/hgdev/image_process.cpp +++ b/hgdriver/hgdev/image_process.cpp @@ -73,19 +73,19 @@ using namespace std; //动态打开库的命名 #ifdef OEM_HANWANG #ifdef WIN32 - #define IMGPRC_LIBNANE L"HWImgProc.dll" - #define HGBASE_LIBNAME L"HWBase.dll" + #define IMGPRC_LIBNANE L"HwImgProc.dll" + #define HGBASE_LIBNAME L"HwBase.dll" #else - #define IMGPRC_LIBNANE "libHWImgProc.so" - #define HGBASE_LIBNAME "libHWBase.so" + #define IMGPRC_LIBNANE "libHwImgProc.so" + #define HGBASE_LIBNAME "libHwBase.so" #endif #elif defined(OEM_LISICHENG) #ifdef WIN32 - #define IMGPRC_LIBNANE L"LSCImgProc.dll" - #define HGBASE_LIBNAME L"LSCBase.dll" + #define IMGPRC_LIBNANE L"LscImgProc.dll" + #define HGBASE_LIBNAME L"LscBase.dll" #else - #define IMGPRC_LIBNANE "libLSCImgProc.so" - #define HGBASE_LIBNAME "libLSCBase.so" + #define IMGPRC_LIBNANE "libLscImgProc.so" + #define HGBASE_LIBNAME "libLscBase.so" #endif #else #ifdef WIN32 From 62f545669672a6bb4b13425fae822a3c1cb13a78 Mon Sep 17 00:00:00 2001 From: luoliangyi <87842688@qq.com> Date: Wed, 2 Nov 2022 16:02:06 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=9C=AA=E5=88=9D?= =?UTF-8?q?=E5=A7=8B=E5=8C=96handel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hgdriver/hgdev/hg_scanner.cpp | 3 +-- hgdriver/hgdev/image_process.cpp | 28 +++++++++++++++------------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/hgdriver/hgdev/hg_scanner.cpp b/hgdriver/hgdev/hg_scanner.cpp index 800e2b3..f66be4e 100644 --- a/hgdriver/hgdev/hg_scanner.cpp +++ b/hgdriver/hgdev/hg_scanner.cpp @@ -1,4 +1,4 @@ -#include "hg_scanner.h" +#include "hg_scanner.h" #include "../wrapper/hg_log.h" #include "sane/sane_option_definitions.h" #include "scanner_setting.h" @@ -1913,7 +1913,6 @@ int hg_scanner::setting_text_direction(int sn, void* data) } else if (image_prc_param_.bits.text_direction != TEXT_DIRECTION_AUTO && ImagePrc_pHandle_) { - printf("77777777777777777777777777777777\r\n"); hg_imgproc::free_auto_txt_hanld(ImagePrc_pHandle_); } return ret; diff --git a/hgdriver/hgdev/image_process.cpp b/hgdriver/hgdev/image_process.cpp index bab1293..42a9eb4 100644 --- a/hgdriver/hgdev/image_process.cpp +++ b/hgdriver/hgdev/image_process.cpp @@ -208,8 +208,12 @@ namespace hg_imgproc public: imgproc(int pid) : pid_(pid),papersize_(pid_) , img_statu_(SANE_Image_Statu_OK) + ,Dynamicopen_HGBase_pHandle_(NULL) + ,Dynamicopen_HGImageprc_pHandle_(NULL) + { my_path_ = hg_log::pe_path(); + } ~imgproc() { @@ -302,7 +306,6 @@ namespace hg_imgproc if (access(HGBaselib_path.c_str(), F_OK) != 0 && access(HGImagePrclib_path.c_str(), F_OK) != 0) { - printf("111111111111111111111111111\r\n"); return SCANNER_ERR_OUT_OF_RANGE; } printf("HGBaselib_path:%s HGImagePrclib_path:%s\r\n",HGBaselib_path.c_str(),HGImagePrclib_path.c_str()); @@ -341,21 +344,25 @@ namespace hg_imgproc } int free_auto_txt_hanld() { - printf("11111111111111111111111111111----释放hanld\r\n"); - int ret = 0; - if (Dynamicopen_HGImageprc_pHandle_ != NULL) + if (Auto_Txt_pHanld) { -#if (!defined WIN32) + int ret = ocrexit_(Auto_Txt_pHanld); + Auto_Txt_pHanld = NULL; + } + int ret = 0; + if (Dynamicopen_HGImageprc_pHandle_) + { + +#ifndef WIN32 ret = dlclose(Dynamicopen_HGImageprc_pHandle_); #else ret = FreeLibrary(Dynamicopen_HGImageprc_pHandle_); #endif Dynamicopen_HGImageprc_pHandle_ = NULL; } - - if (Dynamicopen_HGBase_pHandle_ != NULL) + if (Dynamicopen_HGBase_pHandle_) { -#if (!defined WIN32) +#ifndef WIN32 ret = dlclose(Dynamicopen_HGBase_pHandle_); #else ret = FreeLibrary(Dynamicopen_HGBase_pHandle_); @@ -363,11 +370,6 @@ namespace hg_imgproc Dynamicopen_HGBase_pHandle_ = NULL; } - if (Auto_Txt_pHanld != NULL) - { - int ret = ocrexit_(Auto_Txt_pHanld); - Auto_Txt_pHanld = NULL; - } return ret; } int decode(int pid, LPSCANCONF img_param, LPIMGPRCPARAM param)