Saving an image (jpg) on a remote server without l

2019-08-14 06:16发布

问题:

I have a linux app programmed in C which uses gdk for image stuff. The images are sent to a remote server through FTP (with libcurl).

Currently I'm saving the images first to a local hard disk with gdk_pixbuf_save, but this seems kinda useless step. How difficult would it be to save the images directly on the remote server? I would also need to use the quality setting of jpg.

回答1:

There is a gdk_pixbuf_save_to_buffer that can store data to a gchar buffer.

I wasn't able to quickly find the CURL API associated with FTP put requests; hopefully you'll be familiar enough with CURL to know how to put a file using a buffer as contents.



标签: c linux ftp jpeg gdk