I found conver png file to base64 but it asks to read from file stream like:
ostringstream sout;
istringstream sin;
// this is the object we will use to do the base64 encoding
base64 base64_coder;
// now base64 encode the compressed data
base64_coder.encode(sin,sout);
I have png in opencv converted like:
imencode(".png", im, buf);
when I want to convert
base64_coder.encode(buf,sout);
it asks stream..
My c++ knowledge is limited so any help appreciated.
The purpose for this:
I need to write png images to the mongodb that can be used by meteorjs . So they are asking base64 encoded . images.
thx
EDIT : im is Cv::Mat . obj. I am converting it to png . buf includes the png.