调整中晶导出ocr错误返回值

This commit is contained in:
yangjiaxuan 2023-02-17 11:05:49 +08:00
parent b5aeace56e
commit 05c0b539b4
2 changed files with 7 additions and 3 deletions

View File

@ -116,8 +116,12 @@ void HGAPI Dialog_ExportImageFile::ThreadFunc(HGThread thread, HGPointer param)
HGImgFmt_CloseImageWriter(writer);
createOcrPdf(tmpFileName, getStdString(fileName).c_str());
bool result = createOcrPdf(tmpFileName, getStdString(fileName).c_str());
QFile::remove(tmpFileName);
if (!result)
{
ret = HGIMGPROC_ERR_OCR;
}
#else
HGOCRMgr ocrMgr = nullptr;
ret = HGImgProc_CreateOCRMgr(0, &ocrMgr);

View File

@ -433,9 +433,9 @@ HGResult MainWindow::saveImage(HGImage image, const HGImgFmtSaveInfo* info, bool
HGChar tmpFileName[256];
HGBase_GetTmpFileName("bmp", tmpFileName, 256);
ret = HGImgFmt_SaveImage(image, 0, info, tmpFileName);
createOcrPdf(tmpFileName, fileName);
bool result = createOcrPdf(tmpFileName, fileName);
QFile::remove(tmpFileName);
return ret;
return (result) ? HGBASE_ERR_OK : HGIMGPROC_ERR_OCR;
#else
// 韫囩晫鏆恑nfo
HGOCRMgr ocrMgr = nullptr;