From 7fd8983389a8ee2487ae555b3ce10c5a122416f4 Mon Sep 17 00:00:00 2001 From: gb <741021719@qq.com> Date: Mon, 26 Sep 2022 17:30:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=8E=B7=E5=8F=96=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E5=80=BC=E4=B8=BASANE=5FFIX=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E6=97=B6=E7=9A=84BUG=EF=BC=9B=E8=AE=B0=E5=BD=95=E6=89=93?= =?UTF-8?q?=E5=BC=80=E5=A4=B1=E8=B4=A5=E6=97=B6=E7=9A=84=E8=BF=9B=E7=A8=8B?= =?UTF-8?q?=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hgdriver/ImageProcess/ImageApplyAutoCrop.cpp | 2 +- hgdriver/hgdev/usb_manager.cpp | 1 + hgsane/sane_hg_mdw.cpp | 6 ++++-- hgsane/sane_hg_mdw.h | 4 ++-- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/hgdriver/ImageProcess/ImageApplyAutoCrop.cpp b/hgdriver/ImageProcess/ImageApplyAutoCrop.cpp index 46f959b..c2724a3 100644 --- a/hgdriver/ImageProcess/ImageApplyAutoCrop.cpp +++ b/hgdriver/ImageProcess/ImageApplyAutoCrop.cpp @@ -204,7 +204,7 @@ void autoCrop_desaskew_fillBlank(const cv::Mat& src, cv::Mat& dst, bool isAutoCr cv::RotatedRect rect = hg::getBoundingRect(maxContour); -#ifndef x86_64 +#ifndef x86_64 // for illegal instruction: vfmadd132ps if (dispersion) { cv::Mat mat_dispersion = src(cv::boundingRect(maxContour)); diff --git a/hgdriver/hgdev/usb_manager.cpp b/hgdriver/hgdev/usb_manager.cpp index 271b4c8..2db9a31 100644 --- a/hgdriver/hgdev/usb_manager.cpp +++ b/hgdriver/hgdev/usb_manager.cpp @@ -629,6 +629,7 @@ bool usb_io::make_singleton(void) str.insert(0, "\350\256\276\345\244\207\345\267\262\347\273\217\350\242\253\350\277\233\347\250\213 '"); str += "' \345\215\240\347\224\250"; init_err_msg_ = str; + VLOG_MINI_1(LOG_LEVEL_FATAL, "Open failed: %s\n", str.c_str()); return false; } diff --git a/hgsane/sane_hg_mdw.cpp b/hgsane/sane_hg_mdw.cpp index cf499cc..ecb2ce6 100644 --- a/hgsane/sane_hg_mdw.cpp +++ b/hgsane/sane_hg_mdw.cpp @@ -1145,8 +1145,10 @@ void* hg_sane_middleware::get_default_value(scanner_handle handle, int option) double v = .0f; jsn->get_value("default", v); - data = local_utility::acquire_memory(sizeof(v), ""); - memcpy(data, &v, sizeof(v)); + SANE_Fixed sd = hg_sane_middleware::double_2_sane_fixed(v); + data = local_utility::acquire_memory(sizeof(sd), ""); + + memcpy(data, &sd, sizeof(sd)); VLOG_MINI_2(LOG_LEVEL_DEBUG_INFO, "option %d default value is: %f\n", option, v); } else if (val == "string") diff --git a/hgsane/sane_hg_mdw.h b/hgsane/sane_hg_mdw.h index 10e8bc2..d4811f6 100644 --- a/hgsane/sane_hg_mdw.h +++ b/hgsane/sane_hg_mdw.h @@ -187,8 +187,8 @@ public: SANE_Option_Descriptor* get_option_descriptor(SANE_Handle h, SANE_Int option); SANE_Status set_option(SANE_Handle h, SANE_Int option, SANE_Action action, void* value, SANE_Int* after_do); - bool get_cur_value(SANE_Handle handle, int option, void* value, SANE_Value_Type* type = NULL); - void* get_def_value(SANE_Handle handle, int option); // caller should call local_utility::free_memory to free the returned value + bool get_cur_value(SANE_Handle handle, int option, void* value, SANE_Value_Type* type = NULL); // SANE_type + void* get_def_value(SANE_Handle handle, int option); // caller should call local_utility::free_memory to free the returned value, SANE_type // extension ... SANE_Status io_control(SANE_Handle h, unsigned long code, void* data, unsigned* len);