Changeset 104
- Timestamp:
- 02/05/06 00:50:10 (3 years ago)
- Files:
-
- fastphoto/trunk/src/cgi.c (modified) (1 diff)
- fastphoto/trunk/src/main.c (modified) (1 diff)
- fastphoto/trunk/src/resize.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
fastphoto/trunk/src/cgi.c
r102 r104 74 74 params->infile = path_translated; 75 75 params->outfile = "/tmp/cache.jpg"; 76 params->x = FASTPHOTO_DEFAULT_X;77 params->y = FASTPHOTO_DEFAULT_Y;76 params->x = 0; 77 params->y = 0; 78 78 79 79 parse_query (params, query_string); fastphoto/trunk/src/main.c
r101 r104 35 35 params.infile = argv[1]; 36 36 params.outfile = argv[2]; 37 params.x = 128;38 params.y = 128;37 params.x = 0; 38 params.y = 0; 39 39 } 40 40 fastphoto/trunk/src/resize.c
r98 r104 7 7 { 8 8 Epeg_Image *im; 9 int x, y; 9 int x, y, w, h; 10 11 im = epeg_file_open(params->infile); 12 13 epeg_size_get (im, &w, &h); 10 14 11 15 x = params->x; 12 16 y = params->y; 13 17 14 im = epeg_file_open(params->infile); 18 if (x == 0 && y == 0) { 19 x = w; 20 y = h; 21 } else if (x == 0) { 22 x = w*y/h; 23 } else if (y == 0) { 24 y = h*x/w; 25 } 15 26 epeg_decode_size_set(im, x, y); 27 16 28 epeg_file_output_set(im, params->outfile); 17 29 epeg_encode(im);
