xfercount加1后再除以2,保证奇数张图片能够出图

This commit is contained in:
gb 2023-07-03 14:53:18 +08:00
parent 14f784dfbe
commit 447e1e94b2
1 changed files with 3 additions and 2 deletions

View File

@ -1795,6 +1795,7 @@ void huagao_ds::init_support_caps(void)
if (dup && count >= 2) if (dup && count >= 2)
{ {
count++;
count /= 2; count /= 2;
} }
SET_SANE_OPT_EX(ret, scanner_, scan_count, &count); SET_SANE_OPT_EX(ret, scanner_, scan_count, &count);
@ -2361,12 +2362,12 @@ void huagao_ds::init_support_caps(void)
int ret = SCANNER_ERR_OK; int ret = SCANNER_ERR_OK;
int count = count_; int count = count_;
if (dup && count_ >= 2) if (dup && count >= 2)
{ {
count /= 2; count /= 2;
SET_SANE_OPT_EX(ret, scanner_, scan_count, &count); SET_SANE_OPT_EX(ret, scanner_, scan_count, &count);
} }
else if (!dup && count_ >= 2) else if (!dup && count >= 2)
SET_SANE_OPT_EX(ret, scanner_, scan_count, &count) SET_SANE_OPT_EX(ret, scanner_, scan_count, &count)
return CapSupGetAllReset<BYTE, Bool, CapType::DuplexEnabled>(msg, data, dup, Bool(true)); return CapSupGetAllReset<BYTE, Bool, CapType::DuplexEnabled>(msg, data, dup, Bool(true));