| 665 | } |
| 666 | |
| 667 | bool Image::initWithImageFileThreadSafe(std::string_view fullpath) |
| 668 | { |
| 669 | bool ret = false; |
| 670 | _filePath = fullpath; |
| 671 | |
| 672 | Data data = FileUtils::getInstance()->getDataFromFile(_filePath); |
| 673 | |
| 674 | if (!data.isNull()) |
| 675 | { |
| 676 | ssize_t n = 0; |
| 677 | auto buf = data.takeBuffer(&n); |
| 678 | ret = initWithImageData(buf, n, true); |
| 679 | } |
| 680 | |
| 681 | return ret; |
| 682 | } |
| 683 | |
| 684 | bool Image::initWithImageData(const uint8_t* data, ssize_t dataLen) |
| 685 | { |
no test coverage detected