解决多页旋转时不能旋转tiff的问题

This commit is contained in:
luoliangyi 2022-05-27 10:22:25 +08:00
parent e2c6fc7c52
commit e7c04c77db
1 changed files with 12 additions and 8 deletions

View File

@ -48,6 +48,8 @@ void Dialog_MultiRotateImageFile::ThreadFunc(HGThread thread, HGPointer param)
emit p->updateProgress(i);
HGImage img = nullptr;
HGImgFmtReader imgFmtReader = nullptr;
HGImgFmt_OpenImageReader(getStdString(p->m_fileList[i]).c_str(), 0, &imgFmtReader);
if (nullptr != imgFmtReader)
@ -56,7 +58,6 @@ void Dialog_MultiRotateImageFile::ThreadFunc(HGThread thread, HGPointer param)
HGImgFmt_GetImagePageCount(imgFmtReader, &pageCount);
if (1 == pageCount)
{
HGImage img = nullptr;
HGImgFmt_LoadImageFromReader(imgFmtReader, 0, nullptr, 0, HGBASE_IMGORIGIN_TOP, &img);
if (nullptr != img)
{
@ -83,7 +84,14 @@ void Dialog_MultiRotateImageFile::ThreadFunc(HGThread thread, HGPointer param)
HGBase_DestroyImage(img);
img = img2;
}
}
}
HGImgFmt_CloseImageReader(imgFmtReader);
}
if (nullptr != img)
{
if (HGBASE_ERR_OK == HGImgFmt_SaveImage(img, 0, nullptr, getStdString(p->m_fileList[i]).c_str()))
{
emit p->updateImageFile(p->m_fileList[i]);
@ -93,10 +101,6 @@ void Dialog_MultiRotateImageFile::ThreadFunc(HGThread thread, HGPointer param)
}
}
HGImgFmt_CloseImageReader(imgFmtReader);
}
}
emit p->finish();
}