Changeset 101
- Timestamp:
- 02/05/06 00:27:39 (3 years ago)
- Files:
-
- fastphoto/trunk/src/cgi.c (modified) (1 diff)
- fastphoto/trunk/src/main.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
fastphoto/trunk/src/cgi.c
r100 r101 4 4 #include "fastphoto.h" 5 5 6 #define CONTENT_TYPE_JPEG "Content-Type: image/jpeg\n \n"6 #define CONTENT_TYPE_JPEG "Content-Type: image/jpeg\n" 7 7 8 8 #define BUFSIZE 4096 fastphoto/trunk/src/main.c
r100 r101 1 #include "config.h" 2 1 3 #include <stdio.h> 2 4 #include <stdlib.h> … … 7 9 #include "resize.h" 8 10 11 static void 12 usage (void) 13 { 14 printf ("FastPhoto " VERSION "\n"); 15 printf ("Usage: fastphoto infile outfile\n"); 16 } 17 9 18 int 10 19 main (int argc, char * argv[]) 11 20 { 12 int cgi = 0; 13 fastphoto_t params; 21 int cgi = 0; 22 fastphoto_t params; 23 24 memset (¶ms, 0, sizeof (fastphoto_t)); 25 26 if (cgi_init(¶ms)) { 27 cgi = 1; 28 content_type_jpeg (); 29 } else { 30 if (argc < 3) { 31 usage (); 32 exit (1); 33 } 14 34 15 memset (¶ms, 1, sizeof (fastphoto_t)); 16 17 if (cgi_init(¶ms)) { 18 cgi = 1; 19 content_type_jpeg (); 20 } else { 21 params.infile = argv[1]; 22 params.outfile = argv[2]; 23 params.x = 128; 24 params.y = 128; 25 } 26 27 resize (¶ms); 28 29 if (cgi) { 30 cgi_send (¶ms); 31 } 32 33 return 0; 35 params.infile = argv[1]; 36 params.outfile = argv[2]; 37 params.x = 128; 38 params.y = 128; 39 } 40 41 resize (¶ms); 42 43 if (cgi) { 44 /* 45 puts ("Content-Type: text/plain\n\n"); 46 printf ("Infile: %s\n", params.infile); 47 printf ("Outfile: %s\n", params.outfile); 48 */ 49 cgi_send (¶ms); 50 } 51 52 return 0; 34 53 }
