//==========获取图片相对路径==
std::string imagePath = "tmp/1.jpg";
std::string imageFilename = "1.jpg";
第一种方法 必须加 “| std::ios::ate” 第二个参数
std::ifstream file(imagePath, std::ios::binary | std::ios::ate);//第二个参数的区别
if (!file) {
std::cout << "Failed to open image file!" << std::endl;
return;
}