I have got this code to save image from buffer:
FILE * fout;
fopen_s(&fout, "output.jpg", "wb");
fwrite(pictureFrame->picture().data(), pictureFrame->picture().size(), 1, fout);
In this way I save cover art using taglib. The "pictureFrame->picture().data()" is char* buffer;
I've just tried to display cover art in gtk+ window. But I've recieved error - argument of type char* is incompatible with parameter of type "const guchar*".
I know, I have to convert char* buffer to unsigned char buffer, but I don't know how. Can anybody help me?
pixbuf_loader = gdk_pixbuf_loader_new ();
gdk_pixbuf_loader_write (pixbuf_loader, pictureFrame->picture().data(), pictureFrame->picture().size(), NULL);
reinterpret_cast. Or you could just copy the whole thing but that's very needlessly inefficient.