GreycLab / CImg

The CImg Library is a small and open-source C++ toolkit for image processing
http://cimg.eu
Other
1.46k stars 278 forks source link

Error with saving #378

Open nagayev opened 1 year ago

nagayev commented 1 year ago

Hello. My code is extremly simple:

cimg_library::CImg<unsigned char> img("test.png");
invert(img);
img.save("test.png"); //Error with saving

invert is a user-defined function.

Error:

[CImg] *** CImgIOException *** cimg::fopen(): Failed to open file 'test.png' with mode 'wb'.
terminate called after throwing an instance of 'cimg_library::CImgIOException'
  what():  cimg::fopen(): Failed to open file 'test.png' with mode 'wb'.