| 11 | | The X server maintains three selections, called \fIPRIMARY\fR, |
|---|
| 12 | | \fISECONDARY\fR and \fICLIPBOARD\fR. The PRIMARY selection is conventionally |
|---|
| 13 | | used to implement copying and pasting via the middle mouse button. The |
|---|
| 14 | | SECONDARY and CLIPBOARD selections are less frequently used by application |
|---|
| 15 | | programs. This program operates on the PRIMARY selection unless otherwise |
|---|
| 16 | | specified. |
|---|
| | 11 | fastphoto is a high-performance rescaling tool for photographic images. It |
|---|
| | 12 | can be installed on a web server as a handler for files of type image/jpeg, |
|---|
| | 13 | providing fast server-side resizing with (optional) transparent caching. |
|---|
| 18 | | By default, this program outputs the selection without modification if both |
|---|
| 19 | | standard input and standard output are terminals (ttys). Otherwise, the |
|---|
| 20 | | current selection is output if standard output is not a terminal |
|---|
| 21 | | (tty), and the selection is set from standard input if standard input |
|---|
| 22 | | is not a terminal (tty). If any input or output options are given then |
|---|
| 23 | | the program behaves only in the requested mode. |
|---|
| | 15 | fastphoto uses libepeg, a high-performance JPEG resizing library which |
|---|
| | 16 | decodes only the DCT coefficients needed to reconstruct an image of the |
|---|
| | 17 | desired size, and avoids colorspace conversions (unless converting color |
|---|
| | 18 | images to grayscale). |
|---|
| | 19 | |
|---|
| | 20 | .SH "COMMANDLINE OPTIONS" |
|---|
| 37 | | \fB\-i\fR, \fB\-\-input\fR |
|---|
| 38 | | read standard input into the selection. |
|---|
| 39 | | |
|---|
| 40 | | .PP |
|---|
| 41 | | \fBOutput options\fR |
|---|
| 42 | | .TP |
|---|
| 43 | | \fB\-o\fR, \fB\-\-output\fR |
|---|
| 44 | | write the selection to standard output. |
|---|
| 45 | | |
|---|
| 46 | | .PP |
|---|
| 47 | | \fBAction options\fR |
|---|
| 48 | | .TP |
|---|
| 49 | | \fB\-c\fR, \fB\-\-clear\fR |
|---|
| 50 | | clear the selection. Overrides all \fIinput\fR options. |
|---|
| 51 | | .TP |
|---|
| 52 | | \fB\-d\fR, \fB\-\-delete\fR |
|---|
| 53 | | Request that the current selection be deleted. This not only clears the |
|---|
| 54 | | selection, but also requests to the program in which the selection |
|---|
| 55 | | resides that the selected contents be deleted. Overrides all \fIinput\fR |
|---|
| 56 | | options. |
|---|
| 57 | | |
|---|
| 58 | | .PP |
|---|
| 59 | | \fBSelection options\fR |
|---|
| 60 | | .TP |
|---|
| 61 | | \fB\-p\fR, \fB\-\-primary\fR |
|---|
| 62 | | operate on the PRIMARY selection (default). |
|---|
| 63 | | .TP |
|---|
| 64 | | \fB\-s\fR, \fB\-\-secondary\fR |
|---|
| 65 | | operate on the SECONDARY selection. |
|---|
| 66 | | .TP |
|---|
| 67 | | \fB\-b\fR, \fB\-\-clipboard\fR |
|---|
| 68 | | operate on the CLIPBOARD selection. |
|---|
| 69 | | |
|---|
| 70 | | .TP |
|---|
| 71 | | \fB\-k\fR, \fB\-\-keep\fR |
|---|
| 72 | | Do not modify the selections, but make the PRIMARY and SECONDARY selections |
|---|
| 73 | | persist even after the programs they were selected in exit. (Conventionally, |
|---|
| 74 | | the CLIPBOARD selection is persisted by a separate special purpose program |
|---|
| 75 | | such as \fIxclipboard(1)\fR). Ignores all \fIinput\fR and \fIoutput\fR |
|---|
| 76 | | options. |
|---|
| 77 | | .TP |
|---|
| 78 | | \fB\-x\fR, \fB\-\-exchange\fR |
|---|
| 79 | | exchange the PRIMARY and SECONDARY selections. Ignores all \fIinput\fR |
|---|
| 80 | | and \fIoutput\fR options. |
|---|
| 81 | | |
|---|
| 82 | | .PP |
|---|
| 83 | | \fBX options\fR |
|---|
| 84 | | .TP |
|---|
| 85 | | \fB\-d\fR \fIdisplayname\fR, \fB\-\-display\fR \fIdisplayname\fR |
|---|
| 86 | | specify the server to use; see \fIX(1)\fP. |
|---|
| 87 | | .TP |
|---|
| 88 | | \fB\-t\fR \fIms\fR, \fB\-\-selectionTimeout\fR \fIms\fR |
|---|
| 89 | | Specify the timeout in milliseconds within which the selection must be |
|---|
| 90 | | retrieved. A value of \fB0\fR (zero) specifies no timeout (default). |
|---|
| | 30 | \fB\-s\fR, \fB\-\-scale\fR |
|---|
| | 31 | Set the scale as a percentage |
|---|
| 114 | | .SH NOTES |
|---|
| 115 | | .PP |
|---|
| 116 | | \fIThere is no X selection buffer.\fR The selection mechanism in X11 is |
|---|
| 117 | | an interclient communication mediated by the X server each time any |
|---|
| 118 | | program wishes to know the selection contents, eg. to perform a middle |
|---|
| 119 | | mouse button paste. In order to implement modification of the selection(s) |
|---|
| 120 | | (in \fIinput\fR, \fIkeep\fR and \fIexchange\fR modes) this program detaches |
|---|
| 121 | | from the terminal, spawning a child process to supply the new selection(s) |
|---|
| 122 | | on demand. This child exits immediately when any other program takes over |
|---|
| 123 | | the selection(s), eg. when the user next selects some text in a terminal |
|---|
| 124 | | window or by running \fBfastphoto -c\fR. |
|---|
| 125 | | .PP |
|---|
| | 46 | .SH "SERVER CONFIGURATION" |
|---|
| | 47 | fastphoto can be installed as a handler for files of type image/jpeg. |
|---|
| | 48 | The following configuration directive is for Apache httpd: |
|---|
| | 49 | |
|---|
| | 50 | ScriptAlias /fastphoto /usr/bin/fastphoto |
|---|
| | 51 | Action image/jpeg /fastphoto |
|---|
| | 52 | |
|---|