This commit is contained in:
13038267101 2023-01-10 09:36:59 +08:00
parent 081fa9dbec
commit d14d5233b7
1 changed files with 15 additions and 12 deletions

View File

@ -887,14 +887,16 @@ public:
{
str.resize(strl);
ret = wchar_to_char(str, p, &strl);
if (str.empty())
{
return SCANNER_ERR_DATA_DAMAGED;
}
dpi = atoi(str.c_str());
}
if (str.empty())
if (dpi > 0)
{
return SCANNER_ERR_DATA_DAMAGED;
ret = helper_->io_control(IO_CTRL_CODE_SET_DPI, &dpi, &len);
}
dpi = atoi(str.c_str());
ret = helper_->io_control(IO_CTRL_CODE_SET_DPI, &dpi, &len);
if (ret != SCANNER_ERR_OK)
{
return -1;
@ -924,13 +926,16 @@ public:
{
str.resize(strl);
ret = wchar_to_char(str, p, &strl);
if (str.empty())
{
return SCANNER_ERR_DATA_DAMAGED;
}
dpi = atoi(str.c_str());
}
if (str.empty())
if (dpi > 0)
{
return SCANNER_ERR_DATA_DAMAGED;
ret = helper_->io_control(IO_CTRL_CODE_SET_DPI, &dpi, &llen);
}
dpi = atoi(str.c_str());
ret = helper_->io_control(IO_CTRL_CODE_SET_DPI, &dpi, &llen);
ret = helper_->io_control(IO_CTRL_CODE_SET_DISTORTION_IMAGE, &type, &len);
if (ret != SCANNER_ERR_OK)
@ -949,8 +954,6 @@ public:
else if (cnt == 10)
break;
Sleep(1000);
cnt++;
}