| 273 | } |
| 274 | |
| 275 | bool Image::initWithImageFile(const ccstd::string &path) { |
| 276 | bool ret = false; |
| 277 | //NOTE: fullPathForFilename isn't threadsafe. we should make sure the parameter is a full path. |
| 278 | // _filePath = FileUtils::getInstance()->fullPathForFilename(path); |
| 279 | _filePath = path; |
| 280 | |
| 281 | const Data data = FileUtils::getInstance()->getDataFromFile(_filePath); |
| 282 | |
| 283 | if (!data.isNull()) { |
| 284 | ret = initWithImageData(data.getBytes(), data.getSize()); |
| 285 | } |
| 286 | |
| 287 | return ret; |
| 288 | } |
| 289 | |
| 290 | bool Image::initWithImageData(const unsigned char *data, uint32_t dataLen) { //NOLINT(misc-no-recursion) |
| 291 | bool ret = false; |
no test coverage detected