Mercurial > hg > digilib
view scaler-api.html @ 1659:fe8300fdcd9d
Creating site for 2.5-SNAPSHOT
author | Robert Casties <casties@mpiwg-berlin.mpg.de> |
---|---|
date | Mon, 20 Nov 2017 20:24:00 +0000 |
parents | 636e7342b1b6 |
children | 1beeb9319d78 |
line wrap: on
line source
<!DOCTYPE html> <!-- | Generated by Apache Maven Doxia at 2017-11-20 | Rendered using Apache Maven Fluido Skin 1.3.0 --> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="Date-Revision-yyyymmdd" content="20171120" /> <meta http-equiv="Content-Language" content="en" /> <title>digilib - The Digital Image Library – The digilib Scaler API</title> <link rel="stylesheet" href="./css/apache-maven-fluido-1.3.0.min.css" /> <link rel="stylesheet" href="./css/site.css" /> <link rel="stylesheet" href="./css/print.css" media="print" /> <script type="text/javascript" src="./js/apache-maven-fluido-1.3.0.min.js"></script> </head> <body class="topBarDisabled"> <div class="container-fluid"> <div id="banner"> <div class="pull-left"> <a href="https://robcast.github.io/digilib/" id="bannerLeft"> <h2>digilib - a versatile image viewing environment for the internet</h2> </a> </div> <div class="pull-right"> <a href="https://robcast.github.io/digilib/" id="bannerRight"> <img src="images/digilib-logo-small.png" /> </a> </div> <div class="clear"><hr/></div> </div> <div id="breadcrumbs"> <ul class="breadcrumb"> <li id="publishDate">Last Published: 2017-11-20</li> <li class="divider">|</li> <li id="projectVersion">Version: 2.5-SNAPSHOT</li> </ul> </div> <div class="row-fluid"> <div id="leftColumn" class="span3"> <div class="well sidebar-nav"> <ul class="nav nav-list"> <li class="nav-header">Overview</li> <li> <a href="index.html" title="About digilib"> <i class="none"></i> About digilib</a> </li> <li> <a href="features.html" title="digilib features"> <i class="none"></i> digilib features</a> </li> <li> <a href="digilib-short.html" title="How digilib works"> <i class="none"></i> How digilib works</a> </li> <li> <a href="history.html" title="Ancient history"> <i class="none"></i> Ancient history</a> </li> <li class="nav-header">Installation</li> <li> <a href="build-maven.html" title="Building digilib"> <i class="none"></i> Building digilib</a> </li> <li> <a href="install-digilib.html" title="Installing digilib"> <i class="none"></i> Installing digilib</a> </li> <li> <a href="server-setups.html" title="Server setups"> <i class="none"></i> Server setups</a> </li> <li class="nav-header">Configuration</li> <li> <a href="digilib-config.html" title="Configuring digilib"> <i class="none"></i> Configuring digilib</a> </li> <li> <a href="image-directories.html" title="Directory layout"> <i class="none"></i> Directory layout</a> </li> <li> <a href="java-settings.html" title="Java settings and tuning"> <i class="none"></i> Java settings and tuning</a> </li> <li> <a href="auth.html" title="Access control"> <i class="none"></i> Access control</a> </li> <li class="nav-header">Development</li> <li class="active"> <a href="#"><i class="none"></i>The digilib Scaler API</a> </li> <li> <a href="iiif-api.html" title="The digilib IIIF API"> <i class="none"></i> The digilib IIIF API</a> </li> <li> <a href="client-integration.html" title="Integrating digilib into your page"> <i class="none"></i> Integrating digilib into your page</a> </li> <li> <a href="plugins.html" title="Digilib plugins"> <i class="none"></i> Digilib plugins</a> </li> <li class="nav-header">Project Documentation</li> <li> <a href="project-info.html" title="Project Information"> <i class="icon-chevron-right"></i> Project Information</a> </li> </ul> <hr class="divider" /> <div id="poweredBy"> <div class="clear"></div> <div class="clear"></div> <div class="clear"></div> <a href="http://maven.apache.org/" title="Built by Maven" class="builtBy"> <img class="builtBy" alt="Built by Maven" src="https://maven.apache.org/images/logos/maven-feather.png" /> </a> <a href="../../" title="Hosted by GitHub" class="builtBy"> <img class="builtBy" alt="Hosted by GitHub" src="https://assets-cdn.github.com/images/modules/logos_page/GitHub-Logo.png" width="200px" /> </a> <a href="http://www.sourceforge.net/" title="Hosted by SourceForge" class="builtBy"> <img class="builtBy" alt="Hosted by SourceForge" src="https://upload.wikimedia.org/wikipedia/commons/0/0b/Sourceforge_logo.png" /> </a> </div> </div> </div> <div id="bodyColumn" class="span9" > <h1>The digilib Scaler API</h1> <p>The Scaler servlet takes parameters in the HTTP query string format:</p> <div class="source"> <div class="source"> <pre>http://host.domain/digilib/Scaler/request_path/?param1=value1&param2=value2&... </pre></div></div> <p>Unknown parameters will be silently ignored.</p> <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> <ul> <li><tt>request_path</tt>: (optional) path to file or directory.</li> <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> <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> <li><tt>dw</tt>: destination image width (pixels). If omitted the image is scaled to fit <tt>dh.</tt></li> <li><tt>dh</tt>: destination image height (pixels). If omitted the image is scaled to fit <tt>dw</tt>.</li> <li><tt>wx</tt>: relative x offset of the image area to be sent (0 <= <tt>wx</tt> <= 1). Default: 0.</li> <li><tt>wy</tt>: relative y offset of the image area to be sent (0 <= <tt>wy</tt> <= 1). Default: 0.</li> <li><tt>ww</tt>: relative width of the image area to be sent (0 <= <tt>ww</tt> <= 1). Default: 1.</li> <li><tt>wh</tt>: relative height of the image area to be sent (0 <= <tt>wh</tt> <= 1). Default: 1.</li> <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> <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> <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> <li><tt>rot</tt>: rotate image. Rotation angle is given in degrees. Default: 0</li> <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> <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> <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> <li><tt>ddpix</tt>: resolution of client display in x direction for <tt>osize</tt> mode.</li> <li><tt>ddpiy</tt>: resolution of client display in y direction for <tt>osize</tt> mode.</li> <li><tt>scale</tt>: absolute scale factor applied to the highest resolution image for <tt>ascale</tt> mode.</li> <li><tt>colop</tt>: color operation. One of <ul> <li><tt>GRAYSCALE</tt> (produces grayscale image)</li> <li><tt>NTSC_GRAY</tt> (uses NTSC formula to produce grayscale image)</li> <li><tt>BITONAL</tt> (produces black-and-white image)</li> <li><tt>INVERT</tt> (inverts colors)</li> <li><tt>MAP_GRAY_BGR</tt> (produces false-color image mapping brightness values to color scale from blue via green to red).</li> </ul></li> <li><tt>mo</tt>: list of options for the mode of operation separated by comma “,”. <ul> <li><tt>fit</tt>: scale the (selected area of the) image proportionally to fit inside [dw x dh], preserving its aspect ratio (default).</li> <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> <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> <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> <li><tt>clip</tt>: send the file in the highest resolution, cropped to fit [<tt>dw</tt> x <tt>dh</tt>].</li> <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> <li><tt>ascale</tt>: scale the highest resolution image by an absolute factor given by the <tt>scale</tt> parameter.</li> <li><tt>file</tt>: send the file as-is (may be very large and all sorts of image types!). If the configuration doesn’t allow sending files (<tt>sendfile-allowed=false</tt>) revert to <tt>clip</tt>.</li> <li><tt>rawfile</tt>: send the file as-is with a mime-type of “application/octet-stream” so the browser presents a download dialog.</li> <li><tt>errtxt</tt>: send error response as plain text.</li> <li><tt>errimg</tt>: send error response as image (default).</li> <li><tt>errcode</tt>: send error response as HTTP status code.</li> <li><tt>q0</tt>-<tt>q2</tt>: quality of interpolation in scaling (q0: worst, q2 best).</li> <li><tt>hires</tt>: only use the highest resolution image.</li> <li><tt>autores</tt>: use the pre-scaled image that is bigger than the requested size (default).</li> <li><tt>lores</tt>: prefer the next-smaller pre-scaled image.</li> <li><tt>vmir</tt>: mirror image vertically.</li> <li><tt>hmir</tt>: mirror image horizontally.</li> <li><tt>jpg</tt>: the resulting image is always sent as JPEG (otherwise TIFF and PNG images are sent as PNG).</li> <li><tt>png</tt>: the resulting image is always sent as PNG (otherwise JPEG and J2K images are sent as JPEG).</li> <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> </ul></li> </ul> <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> <ul> <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> <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> </ul> <p>Find more information on the directory layout <a href="image-directories.html">here</a>.</p> <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> <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> </div> </div> </div> <hr/> <footer> <div class="container-fluid"> <div class="row span12">Copyright © 2001-2017 <a href="https://robcast.github.io/digilib/">digilib Community</a>. All Rights Reserved. </div> </div> </footer> </body> </html>