增加错误处理

streaming
Matthew 4 months ago
parent e0d1cbb60a
commit 70ff5e7ea2

@ -3683,6 +3683,16 @@ bool CPhoneDevice::PostProcessPhoto(const PHOTO_INFO& photoInfo, const vector<ID
if (res/* && imgFileSize > 0*/) if (res/* && imgFileSize > 0*/)
{ {
res = (rename(tmpPath.c_str(), fullPath.c_str()) == 0); res = (rename(tmpPath.c_str(), fullPath.c_str()) == 0);
if (res)
{
imgFileSize = getFileSize(tmpPath);
if (imgFileSize == 0)
{
XYLOG(XYLOG_SEVERITY_ERROR, "Empty File after rename %s", fullPath.c_str() + m_appPath.size());
res = false;
}
}
} }
#else #else
bool res = cv::imwrite(fullPath.c_str(), mat, params); bool res = cv::imwrite(fullPath.c_str(), mat, params);

Loading…
Cancel
Save