Re: curl and grabbing images ?
Date: Thu, 24 Mar 2005 09:54:34 -0800
Ok, using libcurl and curl command line are pretty different. You
should read the documentation for curl_easy_setopt and find the options
you want. In a nutshell, the "| djpeg -bmp -grayscale > image222.bmp"
is not included in the URL. The URL parameter is not a unix shell (or
dos shell) command line, it is just the URL. So you will need to
download the jpeg first and then invoke djpeg (using a system call) to
convert it to a bitmap. To save the jpeg to a file, you'll need to
fopen the target file, and then pass the FILE* to curl as the
CURLOPT_WRITEDATA parameter. See the curl_easy_setopt docs for more info.
Hien Nguyen wrote:
> Hi all,
> I am programming Visual C with curl library. I try to capture an image
> from a server to process. If I use:
> curl_easy_setopt(curl, CURLOPT_URL,
> "http://192.168.1.226/jpg/image.jpg | djpeg -bmp -grayscale >
> There's no error. However, I do not find the image222.bmp.
> For the curl command line, that's okie.
> Please help me. Thank you.
Received on 2005-03-24