diff --git a/hgdriver/hgdev/hg_scanner.cpp b/hgdriver/hgdev/hg_scanner.cpp index 95f6bea..0bfd0ed 100644 --- a/hgdriver/hgdev/hg_scanner.cpp +++ b/hgdriver/hgdev/hg_scanner.cpp @@ -183,6 +183,13 @@ hg_scanner::hg_scanner(ScannerSerial serial, const char* dev_name, usb_io* io, i if (hg_log::ini_get("func", "no-paper-chk") == "1") no_paper_check_ = true; + std::string CurExe_path(""); + std::string oem_name(PRODUCT_VENDOR); + hg_log::pe_path(&CurExe_path); + std::transform(CurExe_path.begin(), CurExe_path.end(), CurExe_path.begin(), ::toupper); + std::transform(oem_name.begin(), oem_name.end(), oem_name.begin(), ::toupper); + is_hg_app_ = CurExe_path.find(oem_name) != std::string::npos; + std::string mem = hg_log::ini_get("mem", "max_img"); if (!mem.empty()) { @@ -4324,7 +4331,7 @@ int hg_scanner::get_image_info(SANE_Parameters* ii, int len) this_thread::sleep_for(chrono::milliseconds(10)); if (final_imgs_.size() <= 0 - || user_cancel_) // for BUG-891 !!! + || (user_cancel_ && !is_hg_app_)) // for BUG-891 !!! //2024-02-07, add "is_hg_app_", for BUG-903 { ret = SCANNER_ERR_NO_DATA; if(user_cancel_ && final_imgs_.size()) diff --git a/hgdriver/hgdev/hg_scanner.h b/hgdriver/hgdev/hg_scanner.h index 0a3e902..4828303 100644 --- a/hgdriver/hgdev/hg_scanner.h +++ b/hgdriver/hgdev/hg_scanner.h @@ -290,6 +290,7 @@ protected: volatile bool run_; volatile bool is_read_int; volatile bool user_cancel_; + bool is_hg_app_ = true; platform_event wait_usb_; platform_event wait_img_; platform_event wait_usb_result_;