Changeset 122

Show
Ignore:
Timestamp:
02/07/06 01:24:34 (3 years ago)
Author:
conrad
Message:

flesh out docs and cgi options

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • fastphoto/trunk/fastphoto.1

    r117 r122  
    1717desired size, and avoids colorspace conversions (unless converting color 
    1818images to grayscale). 
     19.PP 
     20fastphoto preserves the aspect of the original file unless both width and 
     21height options are specified. 
    1922 
    2023.SH "COMMANDLINE OPTIONS" 
     
    5861.SH "SERVER CONFIGURATION" 
    5962fastphoto can be installed as a handler for files of type image/jpeg. 
    60 The following configuration directive is for Apache httpd: 
     63The following configuration directives are for Apache httpd. 
    6164 
    6265  ScriptAlias /fastphoto /usr/bin/fastphoto 
    6366  Action image/jpeg /fastphoto 
    6467 
     68.SH "CGI PARAMETERS" 
     69.TP 
     70\fB\?x\fR, \fB\?width\fR 
     71\fB\?y\fR, \fB\?height\fR 
     72\fB\?s\fR, \fB\?scale\fR 
     73\fB\?q\fR, \fB\?quality\fR 
     74\fB\?g\fR, \fB\?gray\fR 
     75 
     76.SH "EXAMPLES" 
     77  http://www.example.com/photo.jpg?scale=10% 
     78  http://www.example.com/photo.jpg?x=120 
     79  http://www.example.com/photo.jpg?x=120&y=10 
     80  http://www.example.com/photo.jpg?q=20 
     81  http://www.example.com/photo.jpg?x=120&q=20 
     82  http://www.example.com/photo.jpg?gray 
     83  http://www.example.com/photo.jpg?x=120&gray 
    6584.SH "SEE ALSO" 
    6685httpd(8), apache(8) 
  • fastphoto/trunk/src/cgi.c

    r120 r122  
    1313set_param (fastphoto_t * params, char * key, char * val) 
    1414{ 
    15   if (!strcmp ("x", key)) params->x = atoi(val); 
    16   if (!strcmp ("y", key)) params->y = atoi(val); 
    17   if (!strcmp ("scale", key)) params->scale = atoi(val); 
    18   if (!strcmp ("gray", key)) params->gray = 1; 
    19   if (!strcmp ("quality", key)) params->quality = atoi(val); 
    20   if (!strcmp ("q", key)) params->quality = atoi(val); 
     15  if (!strncmp ("x", key, 2)) params->x = atoi(val); 
     16  if (!strncmp ("width", key, 6)) params->x = atoi(val); 
     17 
     18  if (!strncmp ("y", key, 2)) params->y = atoi(val); 
     19  if (!strncmp ("height", key, 7)) params->y = atoi(val); 
     20 
     21  if (!strncmp ("s", key, 2)) params->y = atoi(val); 
     22  if (!strncmp ("scale", key, 6)) params->scale = atoi(val); 
     23 
     24  if (!strncmp ("g", key, 2)) params->gray = 1; 
     25  if (!strncmp ("gray", key, 5)) params->gray = 1; 
     26 
     27  if (!strncmp ("quality", key, 8)) params->quality = atoi(val); 
     28  if (!strncmp ("q", key, 2)) params->quality = atoi(val); 
    2129} 
    2230