Mercurial > hg > digilib-old
annotate servlet/doc/Scaler.html @ 182:31367c3c8202
Servlet version 1.18b1
- new transfer mode "rawfile" with mime-type application/octet-stream
- finally proper logging with Log4J!
- therefore a lot of debugging-prints changed
- the Util class is now useless
- ServletOps and FileOps are now purely static
author | robcast |
---|---|
date | Fri, 21 Nov 2003 00:30:04 +0100 |
parents | 3258490649b5 |
children | 250f3b8762e4 |
rev | line source |
---|---|
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 | |
178 | 9 <p>A Servlet for scaling images. (Version 1.16b2)</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 |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
131
diff
changeset
|
30 <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
|
31 dh.</li> |
80 | 32 |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
131
diff
changeset
|
33 <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
|
34 dw.</li> |
1 | 35 |
36 <li><b>wx</b> relative x offset of the image area to be sent (0 <= wx <= 1). | |
80 | 37 Default: 0.</li> |
38 | |
39 <li><b>wy</b> relative y offset of the image area to be sent (0 <= wy <= 1). | |
40 Default: 0.</li> | |
41 | |
42 <li><b>ww</b> relative width of the image area to be sent (0 <= ww <= 1). | |
43 Default: 1.</li> | |
44 | |
45 <li><b>wh</b> relative height of the image area to be sent (0 <= wh <= 1). | |
46 Default: 1.</li> | |
1 | 47 |
48 <li><b>ws</b> additional scaling factor. The resulting image will have the size | |
80 | 49 <code>[ws*dw,ws*dh]</code>. Default: 1.</li> |
1 | 50 |
109 | 51 <li><b>mo</b> flags for the mode of operation separated by ",". |
1 | 52 <ul> |
80 | 53 <li><b>fit</b>: always scale the image to fit |
109 | 54 <code>[dw,dh]</code>.<br> |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
131
diff
changeset
|
55 |
109 | 56 <b>file</b>: send the file as-is (may |
80 | 57 be very large and all sorts of image types!). If configuration |
58 doesn't allow sending files | |
59 (<code>sendfile-allowed=false</code>) revert to | |
109 | 60 <code>clip</code>.<br> |
182 | 61 |
62 <b>rawfile</b>: send the file as-is with a mime-type of | |
63 <code>application/octet-stream</code> so it can be downloaded with | |
64 the browser.<br> | |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
131
diff
changeset
|
65 |
109 | 66 <b>clip</b>: send the file in its |
80 | 67 original resolution, cropped to fit <code>[dw,dh]</code>.<br> If |
68 none of these flags is set heuristics is used (send unzoomed GIF | |
131 | 69 as-is).<br> |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
131
diff
changeset
|
70 |
131 | 71 <b>osize</b>: scale to original size based on the image resolution |
72 (from the image metadata) and display resolution (from parameter | |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
131
diff
changeset
|
73 <code>ddpi</code>). Fails if either resolution is unknown. |
131 | 74 </li> |
80 | 75 |
1 | 76 <li><b>errtxt</b>: send error response as HTML.<br> |
80 | 77 <b>errimg</b>: response as image (default).</li> |
1 | 78 |
79 <li><b>q0</b>-<b>q2</b>: quality of interpolation in scaling | |
80 | 80 (<code>q0</code>: worst, default).</li> |
1 | 81 |
82 <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
|
83 |
80 | 84 <b>hires</b>: always use unscaled image.<br> |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
131
diff
changeset
|
85 |
80 | 86 If the image is zoomed (ww, wh < 1) the unscaled image is |
87 used in any case.</li> | |
88 | |
89 <li><b>vmir</b>: mirror image vertically.<br> | |
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
131
diff
changeset
|
90 |
80 | 91 <b>hmir</b>: mirror image horizontally.</li> |
1 | 92 </ul> |
80 | 93 </li> |
1 | 94 |
80 | 95 <li><b>cont</b>: change contrast of the image. Negative value |
96 reduces contrast, positive value enhances contrast. Pixel value is | |
81 | 97 multiplied by 2^cont. Default: 0</li> |
80 | 98 |
99 <li><b>brgt</b>: change brightness of image. Negative value reduces | |
109 | 100 brightness, positive value enhances brightness. The value brgt is |
101 added to the pixel value. Default: 0</li> | |
80 | 102 |
109 | 103 <li><b>rot</b>: rotate image. Rotation angle is given in |
104 degrees. Default: 0</li> | |
105 | |
106 <li><b>rgbm</b>: modify color by multiplication. The contrast of the | |
107 red green and blue components of the image can be reduced or | |
108 enhanced similar to the <code>cont</code> parameter. The factors for | |
109 red, green and blue are separated by slashes (for example | |
110 0.86/0/-0.5). Default: 0/0/0</li> | |
111 | |
112 <li><b>rgba</b>: modify color by addition. The brightness of the red | |
113 green and blue components of the image can be reduced or enhanced | |
114 similar to the <code>brgt</code> parameter. The factors for red, | |
115 green and blue are separated by slashes (for example | |
116 100/0/25). Default: 0/0/0</li> | |
80 | 117 |
131 | 118 <li><b>ddpi</b>: resolution of client display for <code>osize</code> mode. |
119 Either <code>ddpi</code> or <code>ddpix</code> and <code>ddpiy</code> must | |
120 be set to use <code>osize</code> mode.</li> | |
121 | |
122 <li><b>ddpix</b>: resolution of client display in x direction for | |
123 <code>osize</code> mode.</li> | |
124 | |
125 <li><b>ddpiy</b>: resolution of client display in y direction for | |
126 <code>osize</code> mode.</li> | |
127 | |
1 | 128 </ul> |
129 The image will be scaled equally in horizontal and vertical direction such that | |
130 the resulting image does not exceed the rectangle <code>[ww,wh]</code>. | |
131 </p> | |
132 | |
133 </BODY> | |
134 </HTML> |