7 void Image_Handler(FCGIContext * context, const char * params)
9 static CvCapture * capture = NULL;
11 capture = cvCreateCameraCapture(-1);
13 static int p[] = {CV_IMWRITE_JPEG_QUALITY, 100, 0};
15 IplImage * frame = cvQueryFrame(capture);
16 assert(frame != NULL);
17 CvMat * jpg = cvEncodeImage(".jpg", frame, p);
20 Log(LOGNOTE, "Sending image!");
21 FCGI_PrintRaw("Content-type: image/jpg\r\n\r\n");
22 //FCGI_PrintRaw("Content-Length: %d", jpg->rows*jpg->cols);
23 FCGI_WriteBinary(jpg->data.ptr,1,jpg->rows*jpg->cols);