This commit is contained in:
gb 2022-08-12 15:32:47 +08:00
commit 8aba11e6ec
1 changed files with 35 additions and 21 deletions

View File

@ -825,8 +825,10 @@ void MainWindow::on_new_image(void *img, int statu)
if (1 == m_scanType)
{
QString fileName = getCacheFileName(image);
HGImgFmt_SaveImage(image, 0, nullptr, getStdString(fileName).c_str());
HGResult ret = HGImgFmt_SaveImage(image, 0, nullptr, getStdString(fileName).c_str());
if(ret == HGBASE_ERR_OK)
{
if(statu != SANE_Image_Statu_OK)
{
int ind = 0;
@ -850,6 +852,12 @@ void MainWindow::on_new_image(void *img, int statu)
++m_scanInsertPos;
}
}
else
{
m_dialogLog->addLog(tr("save failed"), true);
m_wndStatusBar->setDeviceStatusInfo(tr("save failed"), true);
}
}
else if (2 == m_scanType)
{
++m_aquireIntoPageIndex;
@ -1018,12 +1026,14 @@ void MainWindow::on_new_image(void *img, int statu)
saveInfo.tiffCompression = HGIMGFMT_TIFFCOMP_JPEG;
}
saveImage(image, &saveInfo, m_aquireIntoSaveParam.m_isOcr, getStdString(scanFileName).c_str());
HGResult ret = saveImage(image, &saveInfo, m_aquireIntoSaveParam.m_isOcr, getStdString(scanFileName).c_str());
if(ret == HGBASE_ERR_OK)
{
m_thumb->addItem(scanFileName);
++m_aquireIntoSaveParam.m_fileNameStartIndex;
}
}
}
m_currScanCount++;
HGBase_DestroyImage(image);
@ -1873,6 +1883,8 @@ void MainWindow::on_act_save_triggered()
else
{
QMessageBox::information(this, tr("info"), tr("save failed"));
m_dialogLog->addLog(tr("save failed"), true);
m_wndStatusBar->setDeviceStatusInfo(tr("save failed"), true);
}
}
else
@ -2009,6 +2021,8 @@ void MainWindow::on_act_saveAs_triggered()
else
{
QMessageBox::information(this, tr("info"), tr("save failed"));
m_dialogLog->addLog(tr("save failed"), true);
m_wndStatusBar->setDeviceStatusInfo(tr("save failed"), true);
}
}
else