<< isDefaultUserIcon;
if (img.IsEmpty() && !isDefaultUserIcon) {
base::FilePath image_path = base::FilePath(kDefaultUserIconPath);
- std::optional<std::vector<uint8_t>> bytes =
- base::ReadFileToBytes(image_path);
- if (bytes) {
- LOG(INFO) << "Read bytes success. size: " << bytes->size();
- //SetUserIcon(
- //TODO:[NextBrowser][Merging]
- //commented the code temporarily to fix the build error
- //gfx::Image::CreateFrom1xPNGBytes(bytes->data(), bytes->size()));
- }
+ std::string image_data;
+ bool read = base::ReadFileToString(image_path, &image_data);
+ LOG(INFO)<<"read: "<<read;
+ if (read) {
+ LOG(INFO) << "Read image_data success. size: " << image_data.size();
+ SetUserIcon(gfx::Image::CreateFrom1xPNGBytes(base::as_byte_span(image_data)));
+ }
} else {
LOG(INFO) << "Image decoded successfully";
SetUserIcon(img);