From 07079f27765db7b5a90c7a991c5e279336397e73 Mon Sep 17 00:00:00 2001 From: gb <741021719@qq.com> Date: Tue, 21 Nov 2023 16:43:19 +0800 Subject: [PATCH] =?UTF-8?q?imageLayoutGet=E5=9C=A8=E6=89=93=E5=BC=80?= =?UTF-8?q?=E8=AE=BE=E5=A4=87=E6=9C=AA=E5=90=AF=E5=8A=A8=E6=89=AB=E6=8F=8F?= =?UTF-8?q?=E5=89=8D=EF=BC=8C=E8=BF=94=E5=9B=9E=E6=88=90=E5=8A=9F=EF=BC=88?= =?UTF-8?q?=E9=BB=98=E8=AE=A4A3=E5=B0=BA=E5=AF=B8=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=EF=BC=89=20-=20=E7=AB=8B=E6=80=9D=E8=BE=B0=E6=89=AB=E6=8F=8F?= =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- twain/twain/huagaods.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/twain/twain/huagaods.cpp b/twain/twain/huagaods.cpp index bab02c9..00c1dde 100644 --- a/twain/twain/huagaods.cpp +++ b/twain/twain/huagaods.cpp @@ -1348,14 +1348,18 @@ Result huagao_ds::imageInfoGet(const Identity&, ImageInfo& data) Result huagao_ds::imageLayoutGet(const Identity&, ImageLayout& data) { SANE_Parameters head = { 0 }; + int res = 200; if (!scanner_.get()) return seqError(); else if(get_scanned_image_count(-1) == 0) - return { ReturnCode::Failure, condition_code_from_hg_error(scanner_->last_error()) }; - - int res = 200; - + { + // 立思辰扫描程序会先调用该接口才会启动扫描,故需要返回成功。这里默认返回A3尺寸 + //return { ReturnCode::Failure, condition_code_from_hg_error(scanner_->last_error()) }; + head.pixels_per_line = 297 / 25.4f * 200; + head.lines = 420 / 25.4f * 200; + } + else scanner_->get_first_image_header(&head, NULL, &res); data.setDocumentNumber(1); data.setFrameNumber(1);