imageLayoutGet在打开设备未启动扫描前,返回成功(默认A3尺寸信息) - 立思辰扫描程序流程

This commit is contained in:
gb 2023-11-21 16:43:19 +08:00
parent 2629c961ae
commit 07079f2776
1 changed files with 8 additions and 4 deletions

View File

@ -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);