comparison scaler-api.html @ 1640:1ae8b89d3a86

Creating site for 2.5-SNAPSHOT
author Robert Casties <casties@mpiwg-berlin.mpg.de>
date Tue, 22 Aug 2017 16:38:19 +0000
parents
children 16be3440305b
comparison
equal deleted inserted replaced
-1:000000000000 1640:1ae8b89d3a86
1 <!DOCTYPE html>
2 <!--
3 | Generated by Apache Maven Doxia at 2017-08-22
4 | Rendered using Apache Maven Fluido Skin 1.3.0
5 -->
6 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7 <head>
8 <meta charset="UTF-8" />
9 <meta name="viewport" content="width=device-width, initial-scale=1.0" />
10 <meta name="Date-Revision-yyyymmdd" content="20170822" />
11 <meta http-equiv="Content-Language" content="en" />
12 <title>digilib - The Digital Image Library &#x2013; The digilib Scaler API</title>
13 <link rel="stylesheet" href="./css/apache-maven-fluido-1.3.0.min.css" />
14 <link rel="stylesheet" href="./css/site.css" />
15 <link rel="stylesheet" href="./css/print.css" media="print" />
16
17
18 <script type="text/javascript" src="./js/apache-maven-fluido-1.3.0.min.js"></script>
19
20
21 </head>
22 <body class="topBarDisabled">
23
24
25
26 <div class="container-fluid">
27 <div id="banner">
28 <div class="pull-left">
29 <a href="./" id="bannerLeft">
30 <h2>digilib - a versatile image viewing environment for the internet</h2>
31 </a>
32 </div>
33 <div class="pull-right"> <a href="./" id="bannerRight">
34 <img src="images/digilib-logo-small.png" />
35 </a>
36 </div>
37 <div class="clear"><hr/></div>
38 </div>
39
40 <div id="breadcrumbs">
41 <ul class="breadcrumb">
42
43
44 <li id="publishDate">Last Published: 2017-08-22</li>
45 <li class="divider">|</li> <li id="projectVersion">Version: 2.5-SNAPSHOT</li>
46
47
48
49
50 </ul>
51 </div>
52
53
54 <div class="row-fluid">
55 <div id="leftColumn" class="span3">
56 <div class="well sidebar-nav">
57
58
59 <ul class="nav nav-list">
60 <li class="nav-header">Overview</li>
61
62 <li>
63
64 <a href="index.html" title="About digilib">
65 <i class="none"></i>
66 About digilib</a>
67 </li>
68
69 <li>
70
71 <a href="features.html" title="digilib features">
72 <i class="none"></i>
73 digilib features</a>
74 </li>
75
76 <li>
77
78 <a href="digilib-short.html" title="How digilib works">
79 <i class="none"></i>
80 How digilib works</a>
81 </li>
82
83 <li>
84
85 <a href="history.html" title="Ancient history">
86 <i class="none"></i>
87 Ancient history</a>
88 </li>
89 <li class="nav-header">Installation</li>
90
91 <li>
92
93 <a href="install-digilib.html" title="Installing digilib">
94 <i class="none"></i>
95 Installing digilib</a>
96 </li>
97
98 <li>
99
100 <a href="build-maven.html" title="Building digilib">
101 <i class="none"></i>
102 Building digilib</a>
103 </li>
104 <li class="nav-header">Configuration</li>
105
106 <li>
107
108 <a href="digilib-config.html" title="Configuring digilib">
109 <i class="none"></i>
110 Configuring digilib</a>
111 </li>
112
113 <li>
114
115 <a href="image-directories.html" title="Directory layout">
116 <i class="none"></i>
117 Directory layout</a>
118 </li>
119
120 <li>
121
122 <a href="java-settings.html" title="Java settings and tuning">
123 <i class="none"></i>
124 Java settings and tuning</a>
125 </li>
126
127 <li>
128
129 <a href="auth.html" title="Access control">
130 <i class="none"></i>
131 Access control</a>
132 </li>
133 <li class="nav-header">Development</li>
134
135 <li class="active">
136
137 <a href="#"><i class="none"></i>The digilib Scaler API</a>
138 </li>
139
140 <li>
141
142 <a href="iiif-api.html" title="The digilib IIIF API">
143 <i class="none"></i>
144 The digilib IIIF API</a>
145 </li>
146
147 <li>
148
149 <a href="client-integration.html" title="Integrating digilib into your page">
150 <i class="none"></i>
151 Integrating digilib into your page</a>
152 </li>
153
154 <li>
155
156 <a href="plugins.html" title="Digilib plugins">
157 <i class="none"></i>
158 Digilib plugins</a>
159 </li>
160 <li class="nav-header">Project Documentation</li>
161
162 <li>
163
164 <a href="project-info.html" title="Project Information">
165 <i class="icon-chevron-right"></i>
166 Project Information</a>
167 </li>
168 </ul>
169
170
171
172 <hr class="divider" />
173
174 <div id="poweredBy">
175 <div class="clear"></div>
176 <div class="clear"></div>
177 <div class="clear"></div>
178 <a href="http://maven.apache.org/" title="Built by Maven" class="builtBy">
179 <img class="builtBy" alt="Built by Maven" src="http://maven.apache.org/images/logos/maven-feather.png" />
180 </a>
181 <a href="http://www.sourceforge.net/" title="Hosted by SourceForge" class="builtBy">
182 <img class="builtBy" alt="Hosted by SourceForge" src="http://upload.wikimedia.org/wikipedia/commons/0/0b/Sourceforge_logo.png" />
183 </a>
184 </div>
185 </div>
186 </div>
187
188
189 <div id="bodyColumn" class="span9" >
190
191 <h1>The digilib Scaler API</h1>
192 <p>The Scaler servlet takes parameters in the HTTP query string format:</p>
193
194 <div class="source">
195 <div class="source">
196 <pre>http://host.domain/digilib/Scaler/request_path/?param1=value1&amp;param2=value2&amp;...
197 </pre></div></div>
198 <p>Unknown parameters will be silently ignored.</p>
199 <p>Recognised parameters (as of Version 2.5.0, for the most up to date information use the source for <a class="externalLink" href="https://sourceforge.net/p/digilib/code/ci/default/tree/servlet/src/main/java/digilib/conf/DigilibServletRequest.java">parameters</a> and <a class="externalLink" href="https://sourceforge.net/p/digilib/code/ci/default/tree/common/src/main/java/digilib/conf/DigilibOption.java">mode options</a> ):</p>
200
201 <ul>
202
203 <li><tt>request_path</tt>: (optional) path to file or directory.</li>
204
205 <li><tt>fn</tt>: path to file or directory. (This path will be added to <tt>request_path</tt>. Either parameter can be empty. All paths are relative to the configured base directory from the <a href="digilib-config.html">digilib-config.xml</a> parameter <tt>basedir-list</tt>).</li>
206
207 <li><tt>pn</tt>: page number. Index into the (alphabetically sorted) directory given by the path. Starts with 1. Ignored if the path points to a file. Default: 1.</li>
208
209 <li><tt>dw</tt>: destination image width (pixels). If omitted the image is scaled to fit <tt>dh.</tt></li>
210
211 <li><tt>dh</tt>: destination image height (pixels). If omitted the image is scaled to fit <tt>dw</tt>.</li>
212
213 <li><tt>wx</tt>: relative x offset of the image area to be sent (0 &lt;= <tt>wx</tt> &lt;= 1). Default: 0.</li>
214
215 <li><tt>wy</tt>: relative y offset of the image area to be sent (0 &lt;= <tt>wy</tt> &lt;= 1). Default: 0.</li>
216
217 <li><tt>ww</tt>: relative width of the image area to be sent (0 &lt;= <tt>ww</tt> &lt;= 1). Default: 1.</li>
218
219 <li><tt>wh</tt>: relative height of the image area to be sent (0 &lt;= <tt>wh</tt> &lt;= 1). Default: 1.</li>
220
221 <li><tt>ws</tt>: additional scaling factor. The resulting image will have the size [<tt>ws</tt>*<tt>dw</tt> x <tt>ws</tt>*<tt>dh</tt>]. Default: 1.</li>
222
223 <li><tt>cont</tt>: change contrast of the image. Negative values reduce contrast, positive values enhance contrast. Each pixel value is multiplied by 2^<tt>cont</tt>. Default: 0</li>
224
225 <li><tt>brgt</tt>: change brightness of image. Negative value reduces brightness, positive value enhances brightness. The value <tt>brgt</tt> is added to each pixel value. Default: 0</li>
226
227 <li><tt>rot</tt>: rotate image. Rotation angle is given in degrees. Default: 0</li>
228
229 <li><tt>rgbm</tt>: modify colour by multiplication. The contrast of the red green and blue components of the image can be reduced or enhanced similar to the <tt>cont</tt> parameter. The factors for red, green and blue are separated by slashes (e.g. <tt>0.86/0/-0.5</tt>). Default: <tt>0/0/0</tt></li>
230
231 <li><tt>rgba</tt>: modify colour by addition. The brightness of the red green and blue components of the image can be reduced or enhanced similar to the <tt>brgt</tt> parameter. The factors for red, green and blue are separated by slashes (e.g. <tt>100/0/25</tt>). Default: <tt>0/0/0</tt></li>
232
233 <li><tt>ddpi</tt>: resolution of client display for <tt>osize</tt> mode. Either <tt>ddpi</tt> or <tt>ddpix</tt> and <tt>ddpiy</tt> must be set to use <tt>osize</tt> mode.</li>
234
235 <li><tt>ddpix</tt>: resolution of client display in x direction for <tt>osize</tt> mode.</li>
236
237 <li><tt>ddpiy</tt>: resolution of client display in y direction for <tt>osize</tt> mode.</li>
238
239 <li><tt>scale</tt>: absolute scale factor applied to the highest resolution image for <tt>ascale</tt> mode.</li>
240
241 <li><tt>colop</tt>: color operation. One of
242
243 <ul>
244
245 <li><tt>GRAYSCALE</tt> (produces grayscale image)</li>
246
247 <li><tt>NTSC_GRAY</tt> (uses NTSC formula to produce grayscale image)</li>
248
249 <li><tt>BITONAL</tt> (produces black-and-white image)</li>
250
251 <li><tt>INVERT</tt> (inverts colors)</li>
252
253 <li><tt>MAP_GRAY_BGR</tt> (produces false-color image mapping brightness values to color scale from blue via green to red).</li>
254 </ul></li>
255
256 <li><tt>mo</tt>: list of options for the mode of operation separated by comma &#x201c;,&#x201d;.
257
258 <ul>
259
260 <li><tt>fit</tt>: scale the (selected area of the) image proportionally to fit inside [dw x dh], preserving its aspect ratio (default).</li>
261
262 <li><tt>squeeze</tt>: scale the (selected area of the) image to fill [dw x dh], changing its aspect ratio (since v2.3.3).</li>
263
264 <li><tt>crop</tt>: scale the (selected area of the) image proportionally to fill [dw x dh] with the shorter side, cropping the longer side (since v2.5).</li>
265
266 <li><tt>fill</tt>: scale the (selected area of the) image proportionally to fill [dw x dh] with the longer side, filling out the image on the shorter side if possible (since v2.3.3).</li>
267
268 <li><tt>clip</tt>: send the file in the highest resolution, cropped to fit [<tt>dw</tt> x <tt>dh</tt>].</li>
269
270 <li><tt>osize</tt>: scale to original size based on image resolution (from the image metadata) and display resolution (from parameter ddpi). Fails if either resolution is unknown.</li>
271
272 <li><tt>ascale</tt>: scale the highest resolution image by an absolute factor given by the <tt>scale</tt> parameter.</li>
273
274 <li><tt>file</tt>: send the file as-is (may be very large and all sorts of image types!). If the configuration doesn&#x2019;t allow sending files (<tt>sendfile-allowed=false</tt>) revert to <tt>clip</tt>.</li>
275
276 <li><tt>rawfile</tt>: send the file as-is with a mime-type of &#x201c;application/octet-stream&#x201d; so the browser presents a download dialog.</li>
277
278 <li><tt>errtxt</tt>: send error response as plain text.</li>
279
280 <li><tt>errimg</tt>: send error response as image (default).</li>
281
282 <li><tt>errcode</tt>: send error response as HTTP status code.</li>
283
284 <li><tt>q0</tt>-<tt>q2</tt>: quality of interpolation in scaling (q0: worst, q2 best).</li>
285
286 <li><tt>hires</tt>: only use the highest resolution image.</li>
287
288 <li><tt>autores</tt>: use the pre-scaled image that is bigger than the requested size (default).</li>
289
290 <li><tt>lores</tt>: prefer the next-smaller pre-scaled image.</li>
291
292 <li><tt>vmir</tt>: mirror image vertically.</li>
293
294 <li><tt>hmir</tt>: mirror image horizontally.</li>
295
296 <li><tt>jpg</tt>: the resulting image is always sent as JPEG (otherwise TIFF and PNG images are sent as PNG).</li>
297
298 <li><tt>png</tt>: the resulting image is always sent as PNG (otherwise JPEG and J2K images are sent as JPEG).</li>
299
300 <li><tt>pxarea</tt>: interpret <tt>wx</tt>, <tt>wy</tt>, <tt>ww</tt>, <tt>wh</tt> as pixel coordinates on the highest resolution image.</li>
301 </ul></li>
302 </ul>
303 <p>The image to be loaded is specified by the <tt>request_path</tt> (deprecated) and/or the <tt>fn</tt> parameter (preferred) and the optional index <tt>pn</tt>:</p>
304
305 <ul>
306
307 <li>if <tt>fn</tt> points to a directory then the file with the index <tt>pn</tt> (in alphabetical order according to ASCII) will be loaded</li>
308
309 <li>if <tt>fn</tt> points to a file (with or without extension) then this file will be loaded (regardless of <tt>pn</tt>).</li>
310 </ul>
311 <p>Find more information on the directory layout <a href="image-directories.html">here</a>.</p>
312 <p>The image will always be scaled equally in horizontal and vertical direction, preserving the aspect ratio (except with <tt>mo=squeeze</tt>), such that the resulting image does not exceed the rectangle [<tt>dw</tt> x <tt>dh</tt>].</p>
313 <p>If only either height or width is given the image is scaled to match only the given dimension. The size of the resulting image in the other dimension is determined by the aspect ratio of the image or the selected area.</p>
314 </div>
315 </div>
316 </div>
317
318 <hr/>
319
320 <footer>
321 <div class="container-fluid">
322 <div class="row span12">Copyright &copy; 2001-2017
323 <a href="http://digilib.sourceforge.net">digilib Community</a>.
324 All Rights Reserved.
325
326 </div>
327
328
329
330 </div>
331 </footer>
332 </body>
333 </html>