1
|
1 <HTML>
|
|
2 <HEAD>
|
|
3 <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
|
82
|
4 <TITLE>Scaler servlet</TITLE>
|
1
|
5 </HEAD>
|
|
6 <BODY>
|
|
7 <H1>Scaler</H1>
|
|
8
|
109
|
9 <p>A Servlet for scaling images. (Version 1.9b)</p>
|
80
|
10
|
|
11 <h2>Web API</h2>
|
1
|
12
|
80
|
13 <p>The Scaler servlet takes parameters in the http request format:
|
|
14 <code>Scaler/request_path/?param1=value1¶m2=value2&...</code>
|
|
15 Unknown parameters will be silently ignored.</p>
|
1
|
16
|
|
17 <p>Recognised parameters:
|
|
18 <ul>
|
80
|
19 <li><b>request_path</b> path to file or directory.</li>
|
1
|
20
|
80
|
21 <li><b>fn</b> path to file or directory below <code>/docuserver/images</code>
|
|
22 (or other configured image directory).
|
1
|
23 This path will be added to the <code>request_path</code> behind the servlet name.
|
80
|
24 Either parameter can be empty.</li>
|
1
|
25
|
|
26 <li><b>pn</b> page number. Index into the (alphabetically sorted) directory
|
|
27 given by the path. Starts with 1. Ignored if the path points to a file.
|
80
|
28 Default: 1.</li>
|
1
|
29
|
80
|
30 <li><b>dw</b> destination image width (pixels).</li>
|
|
31
|
|
32 <li><b>dh</b> destination image height (pixels).</li>
|
1
|
33
|
|
34 <li><b>wx</b> relative x offset of the image area to be sent (0 <= wx <= 1).
|
80
|
35 Default: 0.</li>
|
|
36
|
|
37 <li><b>wy</b> relative y offset of the image area to be sent (0 <= wy <= 1).
|
|
38 Default: 0.</li>
|
|
39
|
|
40 <li><b>ww</b> relative width of the image area to be sent (0 <= ww <= 1).
|
|
41 Default: 1.</li>
|
|
42
|
|
43 <li><b>wh</b> relative height of the image area to be sent (0 <= wh <= 1).
|
|
44 Default: 1.</li>
|
1
|
45
|
|
46 <li><b>ws</b> additional scaling factor. The resulting image will have the size
|
80
|
47 <code>[ws*dw,ws*dh]</code>. Default: 1.</li>
|
1
|
48
|
109
|
49 <li><b>mo</b> flags for the mode of operation separated by ",".
|
1
|
50 <ul>
|
80
|
51 <li><b>fit</b>: always scale the image to fit
|
109
|
52 <code>[dw,dh]</code>.<br>
|
|
53 <b>file</b>: send the file as-is (may
|
80
|
54 be very large and all sorts of image types!). If configuration
|
|
55 doesn't allow sending files
|
|
56 (<code>sendfile-allowed=false</code>) revert to
|
109
|
57 <code>clip</code>.<br>
|
|
58 <b>clip</b>: send the file in its
|
80
|
59 original resolution, cropped to fit <code>[dw,dh]</code>.<br> If
|
|
60 none of these flags is set heuristics is used (send unzoomed GIF
|
|
61 as-is).</li>
|
|
62
|
1
|
63 <li><b>errtxt</b>: send error response as HTML.<br>
|
80
|
64 <b>errimg</b>: response as image (default).</li>
|
1
|
65
|
|
66 <li><b>q0</b>-<b>q2</b>: quality of interpolation in scaling
|
80
|
67 (<code>q0</code>: worst, default).</li>
|
1
|
68
|
|
69 <li><b>lores</b>: try to use scaled image (default)<br>
|
80
|
70 <b>hires</b>: always use unscaled image.<br>
|
|
71 If the image is zoomed (ww, wh < 1) the unscaled image is
|
|
72 used in any case.</li>
|
|
73
|
|
74 <li><b>vmir</b>: mirror image vertically.<br>
|
|
75 <b>hmir</b>: mirror image horizontally.</li>
|
1
|
76 </ul>
|
80
|
77 </li>
|
1
|
78
|
80
|
79 <li><b>cont</b>: change contrast of the image. Negative value
|
|
80 reduces contrast, positive value enhances contrast. Pixel value is
|
81
|
81 multiplied by 2^cont. Default: 0</li>
|
80
|
82
|
|
83 <li><b>brgt</b>: change brightness of image. Negative value reduces
|
109
|
84 brightness, positive value enhances brightness. The value brgt is
|
|
85 added to the pixel value. Default: 0</li>
|
80
|
86
|
109
|
87 <li><b>rot</b>: rotate image. Rotation angle is given in
|
|
88 degrees. Default: 0</li>
|
|
89
|
|
90 <li><b>rgbm</b>: modify color by multiplication. The contrast of the
|
|
91 red green and blue components of the image can be reduced or
|
|
92 enhanced similar to the <code>cont</code> parameter. The factors for
|
|
93 red, green and blue are separated by slashes (for example
|
|
94 0.86/0/-0.5). Default: 0/0/0</li>
|
|
95
|
|
96 <li><b>rgba</b>: modify color by addition. The brightness of the red
|
|
97 green and blue components of the image can be reduced or enhanced
|
|
98 similar to the <code>brgt</code> parameter. The factors for red,
|
|
99 green and blue are separated by slashes (for example
|
|
100 100/0/25). Default: 0/0/0</li>
|
80
|
101
|
1
|
102 </ul>
|
|
103 The image will be scaled equally in horizontal and vertical direction such that
|
|
104 the resulting image does not exceed the rectangle <code>[ww,wh]</code>.
|
|
105 </p>
|
|
106
|
|
107 </BODY>
|
|
108 </HTML>
|