问题
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.
来源:https://stackoverflow.com/questions/9370468/saving-an-image-jpg-on-a-remote-server-without-local-hard-disk