Mercurial > hg > digilib-old
annotate servlet/doc/Scaler.html @ 170:d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
- more generic class for request parameters
- like already done for DiglibConfig
- changes in JSPs for new request stuff
- changes in ImageSize class so size=0 is "wildcard"
- missing dw and dh parameters now treated as wildcards
- changed package name in imageinfo class
| author | robcast |
|---|---|
| date | Wed, 29 Oct 2003 22:47:15 +0100 |
| parents | 737f5cd647e1 |
| children | 3258490649b5 |
| 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 | |
| 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 |
|
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> |
|
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
131
diff
changeset
|
61 |
| 109 | 62 <b>clip</b>: send the file in its |
| 80 | 63 original resolution, cropped to fit <code>[dw,dh]</code>.<br> If |
| 64 none of these flags is set heuristics is used (send unzoomed GIF | |
| 131 | 65 as-is).<br> |
|
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
131
diff
changeset
|
66 |
| 131 | 67 <b>osize</b>: scale to original size based on the image resolution |
| 68 (from the image metadata) and display resolution (from parameter | |
|
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
131
diff
changeset
|
69 <code>ddpi</code>). Fails if either resolution is unknown. |
| 131 | 70 </li> |
| 80 | 71 |
| 1 | 72 <li><b>errtxt</b>: send error response as HTML.<br> |
| 80 | 73 <b>errimg</b>: response as image (default).</li> |
| 1 | 74 |
| 75 <li><b>q0</b>-<b>q2</b>: quality of interpolation in scaling | |
| 80 | 76 (<code>q0</code>: worst, default).</li> |
| 1 | 77 |
| 78 <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
|
79 |
| 80 | 80 <b>hires</b>: always use unscaled image.<br> |
|
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
131
diff
changeset
|
81 |
| 80 | 82 If the image is zoomed (ww, wh < 1) the unscaled image is |
| 83 used in any case.</li> | |
| 84 | |
| 85 <li><b>vmir</b>: mirror image vertically.<br> | |
|
170
d40922628e4a
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
131
diff
changeset
|
86 |
| 80 | 87 <b>hmir</b>: mirror image horizontally.</li> |
| 1 | 88 </ul> |
| 80 | 89 </li> |
| 1 | 90 |
| 80 | 91 <li><b>cont</b>: change contrast of the image. Negative value |
| 92 reduces contrast, positive value enhances contrast. Pixel value is | |
| 81 | 93 multiplied by 2^cont. Default: 0</li> |
| 80 | 94 |
| 95 <li><b>brgt</b>: change brightness of image. Negative value reduces | |
| 109 | 96 brightness, positive value enhances brightness. The value brgt is |
| 97 added to the pixel value. Default: 0</li> | |
| 80 | 98 |
| 109 | 99 <li><b>rot</b>: rotate image. Rotation angle is given in |
| 100 degrees. Default: 0</li> | |
| 101 | |
| 102 <li><b>rgbm</b>: modify color by multiplication. The contrast of the | |
| 103 red green and blue components of the image can be reduced or | |
| 104 enhanced similar to the <code>cont</code> parameter. The factors for | |
| 105 red, green and blue are separated by slashes (for example | |
| 106 0.86/0/-0.5). Default: 0/0/0</li> | |
| 107 | |
| 108 <li><b>rgba</b>: modify color by addition. The brightness of the red | |
| 109 green and blue components of the image can be reduced or enhanced | |
| 110 similar to the <code>brgt</code> parameter. The factors for red, | |
| 111 green and blue are separated by slashes (for example | |
| 112 100/0/25). Default: 0/0/0</li> | |
| 80 | 113 |
| 131 | 114 <li><b>ddpi</b>: resolution of client display for <code>osize</code> mode. |
| 115 Either <code>ddpi</code> or <code>ddpix</code> and <code>ddpiy</code> must | |
| 116 be set to use <code>osize</code> mode.</li> | |
| 117 | |
| 118 <li><b>ddpix</b>: resolution of client display in x direction for | |
| 119 <code>osize</code> mode.</li> | |
| 120 | |
| 121 <li><b>ddpiy</b>: resolution of client display in y direction for | |
| 122 <code>osize</code> mode.</li> | |
| 123 | |
| 1 | 124 </ul> |
| 125 The image will be scaled equally in horizontal and vertical direction such that | |
| 126 the resulting image does not exceed the rectangle <code>[ww,wh]</code>. | |
| 127 </p> | |
| 128 | |
| 129 </BODY> | |
| 130 </HTML> |
