mirror of
https://gitee.com/openharmony/arkui_ace_engine
synced 2025-03-04 23:30:33 +00:00
!38883 【bug】解决realPath返回nullptr提前return问题
Merge pull request !38883 from 吴寅潇/fixRealPathPro
This commit is contained in:
commit
2fbb08a791
@ -319,17 +319,13 @@ std::shared_ptr<RSData> FileImageLoader::LoadImageData(
|
||||
return nullptr;
|
||||
}
|
||||
char realPath[PATH_MAX] = { 0x00 };
|
||||
if (realpath(filePath.c_str(), realPath) == nullptr) {
|
||||
TAG_LOGW(AceLogTag::ACE_IMAGE, "realpath fail! filePath: %{public}s, fail reason: %{public}s src:%{public}s",
|
||||
filePath.c_str(), strerror(errno), src.c_str());
|
||||
return nullptr;
|
||||
}
|
||||
realpath(filePath.c_str(), realPath);
|
||||
auto result = SkData::MakeFromFileName(realPath);
|
||||
if (!result) {
|
||||
TAG_LOGW(AceLogTag::ACE_IMAGE,
|
||||
"read data failed, filePath: %{public}s, src: %{public}s, fail reason: "
|
||||
"read data failed, filePath: %{public}s, realPath: %{public}s, src: %{public}s, fail reason: "
|
||||
"%{public}s",
|
||||
filePath.c_str(), src.c_str(), strerror(errno));
|
||||
filePath.c_str(), src.c_str(), realPath, strerror(errno));
|
||||
}
|
||||
#ifndef USE_ROSEN_DRAWING
|
||||
#ifdef PREVIEW
|
||||
|
Loading…
x
Reference in New Issue
Block a user