fix BUG-905: 设置指定张数扫描结束后,若还有纸,返回一次NO_DOCS通知APP结束该轮扫描

This commit is contained in:
gb 2024-02-26 08:58:52 +08:00
parent 1c4b6a2653
commit 637d282882
1 changed files with 14 additions and 1 deletions

View File

@ -4222,7 +4222,20 @@ int hg_scanner::wait_one_image_from_start(bool& handled)
get_scanner_paperon(has_paper);
if (has_paper == SANE_TRUE)
{
// for BUG-905: 设置了扫描指定张数属性后返回一次SCANNER_ERR_DEVICE_NO_PAPER
if (usb_img_index_ && scan_count_ != -1)
{
VLOG_MINI_2(LOG_LEVEL_DEBUG_INFO, "return SCANNER_ERR_DEVICE_NO_PAPER in start while scanning with given counts(%d) has finished (received %d papers/images)!\n", scan_count_, usb_img_index_);
usb_img_index_ = 0;
ret = SCANNER_ERR_DEVICE_NO_PAPER;
}
else
{
// 默认启动新一轮扫描
handled = false;
}
}
else
ret = SCANNER_ERR_DEVICE_NO_PAPER;
}