Mercurial > hg > digilib-old
annotate servlet/doc/Scaler.html @ 183:250f3b8762e4
updated Scaler docu
author | robcast |
---|---|
date | Tue, 25 Nov 2003 16:18:40 +0100 |
parents | 31367c3c8202 |
children | c9b2938861cf |
rev | line source |
---|---|
183 | 1 <!doctype html public "-//w3c//dtd html 4.0 transitional//en"> |
2 <html> | |
3 <head> | |
1 | 4 <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> |
82 | 5 <TITLE>Scaler servlet</TITLE> |
183 | 6 </head> |
1 | 7 <BODY> |
8 <H1>Scaler</H1> | |
9 | |
178 | 10 <p>A Servlet for scaling images. (Version 1.16b2)</p> |
80 | 11 |
12 <h2>Web API</h2> | |
1 | 13 |
80 | 14 <p>The Scaler servlet takes parameters in the http request format: |
15 <code>Scaler/request_path/?param1=value1¶m2=value2&...</code> | |
16 Unknown parameters will be silently ignored.</p> | |
1 | 17 |
183 | 18 <p>Recognised parameters:</p> |
1 | 19 <ul> |
80 | 20 <li><b>request_path</b> path to file or directory.</li> |
1 | 21 |
80 | 22 <li><b>fn</b> path to file or directory below <code>/docuserver/images</code> |
23 (or other configured image directory). | |
1 | 24 This path will be added to the <code>request_path</code> behind the servlet name. |
80 | 25 Either parameter can be empty.</li> |
1 | 26 |
27 <li><b>pn</b> page number. Index into the (alphabetically sorted) directory | |
28 given by the path. Starts with 1. Ignored if the path points to a file. | |
80 | 29 Default: 1.</li> |
1 | 30 |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
131
diff
changeset
|
31 <li><b>dw</b> destination image width (pixels). If omitted the image is scaled to fit |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
131
diff
changeset
|
32 dh.</li> |
80 | 33 |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
131
diff
changeset
|
34 <li><b>dh</b> destination image height (pixels). If omitted the image is scaled to fit |
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
131
diff
changeset
|
35 dw.</li> |
1 | 36 |
37 <li><b>wx</b> relative x offset of the image area to be sent (0 <= wx <= 1). | |
80 | 38 Default: 0.</li> |
39 | |
40 <li><b>wy</b> relative y offset of the image area to be sent (0 <= wy <= 1). | |
41 Default: 0.</li> | |
42 | |
43 <li><b>ww</b> relative width of the image area to be sent (0 <= ww <= 1). | |
44 Default: 1.</li> | |
45 | |
46 <li><b>wh</b> relative height of the image area to be sent (0 <= wh <= 1). | |
47 Default: 1.</li> | |
1 | 48 |
49 <li><b>ws</b> additional scaling factor. The resulting image will have the size | |
80 | 50 <code>[ws*dw,ws*dh]</code>. Default: 1.</li> |
1 | 51 |
109 | 52 <li><b>mo</b> flags for the mode of operation separated by ",". |
1 | 53 <ul> |
80 | 54 <li><b>fit</b>: always scale the image to fit |
109 | 55 <code>[dw,dh]</code>.<br> |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
131
diff
changeset
|
56 |
109 | 57 <b>file</b>: send the file as-is (may |
80 | 58 be very large and all sorts of image types!). If configuration |
59 doesn't allow sending files | |
60 (<code>sendfile-allowed=false</code>) revert to | |
109 | 61 <code>clip</code>.<br> |
182 | 62 |
63 <b>rawfile</b>: send the file as-is with a mime-type of | |
64 <code>application/octet-stream</code> so it can be downloaded with | |
65 the browser.<br> | |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
131
diff
changeset
|
66 |
109 | 67 <b>clip</b>: send the file in its |
80 | 68 original resolution, cropped to fit <code>[dw,dh]</code>.<br> If |
69 none of these flags is set heuristics is used (send unzoomed GIF | |
131 | 70 as-is).<br> |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
131
diff
changeset
|
71 |
131 | 72 <b>osize</b>: scale to original size based on the image resolution |
73 (from the image metadata) and display resolution (from parameter | |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
131
diff
changeset
|
74 <code>ddpi</code>). Fails if either resolution is unknown. |
131 | 75 </li> |
80 | 76 |
1 | 77 <li><b>errtxt</b>: send error response as HTML.<br> |
80 | 78 <b>errimg</b>: response as image (default).</li> |
1 | 79 |
80 <li><b>q0</b>-<b>q2</b>: quality of interpolation in scaling | |
80 | 81 (<code>q0</code>: worst, default).</li> |
1 | 82 |
83 <li><b>lores</b>: try to use scaled image (default)<br> | |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
131
diff
changeset
|
84 |
80 | 85 <b>hires</b>: always use unscaled image.<br> |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
131
diff
changeset
|
86 |
80 | 87 If the image is zoomed (ww, wh < 1) the unscaled image is |
88 used in any case.</li> | |
89 | |
90 <li><b>vmir</b>: mirror image vertically.<br> | |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
131
diff
changeset
|
91 |
80 | 92 <b>hmir</b>: mirror image horizontally.</li> |
1 | 93 </ul> |
80 | 94 </li> |
1 | 95 |
80 | 96 <li><b>cont</b>: change contrast of the image. Negative value |
97 reduces contrast, positive value enhances contrast. Pixel value is | |
81 | 98 multiplied by 2^cont. Default: 0</li> |
80 | 99 |
100 <li><b>brgt</b>: change brightness of image. Negative value reduces | |
109 | 101 brightness, positive value enhances brightness. The value brgt is |
102 added to the pixel value. Default: 0</li> | |
80 | 103 |
109 | 104 <li><b>rot</b>: rotate image. Rotation angle is given in |
105 degrees. Default: 0</li> | |
106 | |
107 <li><b>rgbm</b>: modify color by multiplication. The contrast of the | |
108 red green and blue components of the image can be reduced or | |
109 enhanced similar to the <code>cont</code> parameter. The factors for | |
110 red, green and blue are separated by slashes (for example | |
111 0.86/0/-0.5). Default: 0/0/0</li> | |
112 | |
113 <li><b>rgba</b>: modify color by addition. The brightness of the red | |
114 green and blue components of the image can be reduced or enhanced | |
115 similar to the <code>brgt</code> parameter. The factors for red, | |
116 green and blue are separated by slashes (for example | |
117 100/0/25). Default: 0/0/0</li> | |
80 | 118 |
131 | 119 <li><b>ddpi</b>: resolution of client display for <code>osize</code> mode. |
120 Either <code>ddpi</code> or <code>ddpix</code> and <code>ddpiy</code> must | |
121 be set to use <code>osize</code> mode.</li> | |
122 | |
123 <li><b>ddpix</b>: resolution of client display in x direction for | |
124 <code>osize</code> mode.</li> | |
125 | |
126 <li><b>ddpiy</b>: resolution of client display in y direction for | |
127 <code>osize</code> mode.</li> | |
128 | |
1 | 129 </ul> |
183 | 130 |
131 <p>The image to be loaded can be specified by the | |
132 <code>request_path</code> (deprecated) or the <code>fn</code> | |
133 (preferred) parameter and the optional index <code>pn</code></p> | |
134 <ul> | |
135 <li> if <code>fn</code> points to a directory then the file with | |
136 the index <code>pn</code> (in alphabetical order according to | |
137 ASCII) will be loaded</li> | |
138 | |
139 <li>if <code>fn</code> points to a file (with or without | |
140 extension) then this file will be loaded</li> | |
141 </ul> | |
142 | |
143 <p>The image will be scaled equally in horizontal and vertical | |
144 direction such that the resulting image does not exceed the rectangle | |
145 <code>[dw,dh]</code>. If only either height or width is given the | |
146 image is scaled to match only the given parameter. The size of the | |
147 resulting image in the other parameter is determined by the aspect | |
148 ratio of the image. | |
149 </p> | |
1 | 150 |
151 </BODY> | |
183 | 152 </html> |