mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-02-10 18:05:41 +08:00
@ -91,11 +91,9 @@ std::wstring CImagesWorker::GetImage(const std::wstring& sUrl)
|
||||
{
|
||||
CFileDownloader oDownloader(sUrl, false);
|
||||
|
||||
NSFile::CFileBinary file;
|
||||
std::wstring sTmpFile = file.CreateTempFileWithUniqueName(NSFile::CFileBinary::GetTempPath(), L"IMG");
|
||||
|
||||
if (file.Exists(sTmpFile))
|
||||
file.Remove(sTmpFile);
|
||||
std::wstring sTmpFile = NSFile::CFileBinary::CreateTempFileWithUniqueName(NSFile::CFileBinary::GetTempPath(), L"IMG");
|
||||
if (NSFile::CFileBinary::Exists(sTmpFile))
|
||||
NSFile::CFileBinary::Remove(sTmpFile);
|
||||
sTmpFile = sTmpFile + L".png";
|
||||
|
||||
oDownloader.SetFilePath(sTmpFile);
|
||||
@ -116,7 +114,7 @@ std::wstring CImagesWorker::GetImage(const std::wstring& sUrl)
|
||||
|
||||
oFrame.SaveFile(m_sFolder + L"/media/" + sRet, 4);
|
||||
|
||||
file.Remove(sTmpFile);
|
||||
NSFile::CFileBinary::Remove(sTmpFile);
|
||||
return sRet;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user