CImg: Failed to recognize the jpg format

后端 未结 3 1720
傲寒
傲寒 2021-01-13 14:08
#include 
#include 
#include \"CImg.h\"

using namespace cimg_library;
using namespace std;

int main(){
CImg im         


        
3条回答
  •  轮回少年
    2021-01-13 14:48

    What worked for me was using the absolute path to the file, rather than just the file name:

    Ex. Change this: CImg image("lena.jpg"), visu(500,400,1,3,0);

    to this: CImg image("C:\Users\youruser\Desktop\lena.jpg"), visu(500,400,1,3,0);

    Of course, this path would differ depending on where you have your file.

提交回复
热议问题