annotate website/tips.html @ 3:9a472dab7e09

more new documentation
author robcast
date Mon, 12 Dec 2011 20:37:53 +0100
parents 8abbc40d0df5
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
3 <html xmlns="http://www.w3.org/1999/xhtml">
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
4 <head>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
6 <title>digilib -- Digital Image Library</title>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
7 </head>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
8 <body>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
9 <table border="0" cellspacing="0" cellpadding="10">
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
10 <tr>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
11 <td bgcolor="#a0a0a0">&nbsp;</td>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
12 <td>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
13 <img src="images/digilib-logo-big.png" align="left" />
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
14 <h1>
3
9a472dab7e09 more new documentation
robcast
parents: 2
diff changeset
15 <tt>digilib</tt> -- a versatile image viewing environment for the internet
2
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
16 </h1>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
17 </td>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
18 </tr>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
19 <tr>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
20 <td bgcolor="#a0a0a0" valign="top" align="right">
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
21 <p>
3
9a472dab7e09 more new documentation
robcast
parents: 2
diff changeset
22 <b><a href="index.html">Info</a> </b>
2
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
23 </p>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
24 <p>
3
9a472dab7e09 more new documentation
robcast
parents: 2
diff changeset
25 <b><a href="http://developer.berlios.de/projects/digilib/">Project</a> </b>
2
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
26 </p>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
27 <p>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
28 <b><a href="http://developer.berlios.de/project/showfiles.php?group_id=251">Download</a>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
29 </b>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
30 </p>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
31 <p>
3
9a472dab7e09 more new documentation
robcast
parents: 2
diff changeset
32 <b><a href="docs.html">Docs</a></b>
9a472dab7e09 more new documentation
robcast
parents: 2
diff changeset
33 <br />
9a472dab7e09 more new documentation
robcast
parents: 2
diff changeset
34 <a href="build-maven.html">Building</a>
9a472dab7e09 more new documentation
robcast
parents: 2
diff changeset
35 <br />
9a472dab7e09 more new documentation
robcast
parents: 2
diff changeset
36 <a href="digilib-config.html">Configuring</a>
9a472dab7e09 more new documentation
robcast
parents: 2
diff changeset
37 <br />
9a472dab7e09 more new documentation
robcast
parents: 2
diff changeset
38 <a href="http://developer.berlios.de/docman/?group_id=251">...more</a>
2
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
39 </p>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
40 <p>
3
9a472dab7e09 more new documentation
robcast
parents: 2
diff changeset
41 <b><a href="tips.html">Tips</a> </b>
2
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
42 </p>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
43 <p>
3
9a472dab7e09 more new documentation
robcast
parents: 2
diff changeset
44 <b><a href="http://hg.berlios.de/repos/digilib">Source</a> </b>
2
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
45 </p>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
46 </td>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
47 <td>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
48
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
49
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
50 <p>Some tips for running digilib</p>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
51 <ul>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
52 <li>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
53 <a href="#vm_settings">Java VM settings for digilib</a>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
54 </li>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
55 <li>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
56 <a href="#prescaled_images">Prescaled images</a>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
57 </li>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
58 <li>
3
9a472dab7e09 more new documentation
robcast
parents: 2
diff changeset
59 <a href="#installing_jai">Installing JAI</a>
2
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
60 </li>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
61 </ul>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
62
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
63 <h1 id="vm_settings">Java VM settings for digilib</h1>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
64
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
65 <p>The Java virtual machine (Java-VM) only uses a fixed amount of memory for
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
66 its operations. When an operation needs more memory than available it aborts
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
67 with an error ("out of memory error").</p>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
68 <p>digilib can need a lot of memory depending on the size and type of images.
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
69 Since digilib runs as a servlet under Tomcat its in the same VM as the Tomcat
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
70 server.</p>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
71 <p>The amount of memory Tomcat (version 5.0) uses is configured by creating a
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
72 "setenv.sh" script with a line</p>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
73 <pre> CATALINA_OPTS="-Xmx512m"
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
74 </pre>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
75 <p>in Tomcat's "bin" directory (giving 512MB in this case).</p>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
76 <p>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
77 You can check the amount of memory your digilib instance has available on the
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
78 bottom of the web page /server/dlConfig.jsp in your digilib instance (e.g. <a
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
79 href="http://digilib.mpiwg-berlin.mpg.de/digitallibrary/server/dlConfig.jsp"
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
80 class="external free" rel="nofollow">http://digilib.mpiwg-berlin.mpg.de/digitallibrary/server/dlConfig.jsp</a>).
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
81 </p>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
82
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
83 <h1 id="prescaled_images">Prescaled images</h1>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
84
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
85 <p>You can provide any number of scaled-down versions of your images that
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
86 digilib uses when a smaller version of an image is requested. Since less data
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
87 has to be read and processed this can speed up digilib's performance quite a
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
88 lot.</p>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
89 <p>The actual process is that the client requests a certain target size,
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
90 digilib scans all available scaled-down versions of the same image, selects the
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
91 smallest image that is larger than the requested size and scales it down to the
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
92 requested size.</p>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
93 <p>The scaled-down versions of the image have to have the same file name as
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
94 the original hi-res file. They can have a different type and extension (e.g.
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
95 img002.jpg for img002.TIFF)</p>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
96 <p>The scaled down images have to be in the same subdirectory (the part that
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
97 shows up in digilib's "fn" parameter) as the hi-res file. The first part of each
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
98 directory tree is configured by the basedir-list parameter in
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
99 digilib-config.xml.</p>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
100 <p>The sequence of directories in basedir-list is from hi-res to lo-res.
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
101 Images must be present in the hires directory but they need not be present in
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
102 all lower-res directories.</p>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
103 <p>e.g. if digilib-config.xml contains</p>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
104 <pre> &lt;parameter name="basedir-list" value="/images:/scaled:/thumb" /&gt;
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
105 </pre>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
106 <p>and a user requests the image "books/book1/page0002" digilib looks for</p>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
107 <pre> /thumb/books/book1/page0002.*
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
108 /scaled/books/book1/page002.*
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
109 /images/books/book1/page002.*
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
110 </pre>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
111 <p>and uses the first image that is bigger than or equal to the requested
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
112 size.</p>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
113 <p>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
114 For batch-prescaling our images we use a script called "scale-o-mat" that uses a
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
115 lot of freely available imaging libraries (ImageMagick, libtiff, netpbm) and is
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
116 available in our public CVS <a
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
117 href="http://itgroup.mpiwg-berlin.mpg.de/cgi-bin/cvsweb.cgi/scaleomat/"
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
118 class="external autonumber" rel="nofollow">[1]</a>. The script is given a
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
119 hi-res base directory, a destination base directory, a destination size and a
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
120 starting directory. It then processes all files in the starting directory and
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
121 all its subdirectories and creates scaled images in corresponding directories
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
122 under the destination base directory.
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
123 </p>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
124 <p>We currently use prescaled thumbnails of 100 pixels and images for browser
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
125 display of 1500 pixels. Remember that the prescaled image has to be larger (or
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
126 the same size) than the requested image size!</p>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
127 <p>There is another optimization in digilib: if the requested image is exactly
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
128 the same size and type as the prescaled image then the prescaled image is sent
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
129 unmodified to the client which is a lot faster. So it makes sense to produce
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
130 thumbnails of exactly 90 pixels width when they are used in an HTML page where
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
131 all images are 90 pixels wide.</p>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
132
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
133
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
134 <h1 id="installing_jai">Installing JAI</h1>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
135
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
136 <p>
3
9a472dab7e09 more new documentation
robcast
parents: 2
diff changeset
137 In theory you can install the <a
2
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
138 href="http://java.sun.com/javase/technologies/desktop/media/jai/"
3
9a472dab7e09 more new documentation
robcast
parents: 2
diff changeset
139 class="external text" rel="nofollow">Java Advanced Imaging</a> and JAI-ImageIO
9a472dab7e09 more new documentation
robcast
parents: 2
diff changeset
140 JAR files <code>jai_core.jar, jai_codec.jar, jai_imageio.jar</code> (and native
9a472dab7e09 more new documentation
robcast
parents: 2
diff changeset
141 library files if available) in the <code>/WEB-INF/lib/</code> directory of the
9a472dab7e09 more new documentation
robcast
parents: 2
diff changeset
142 digilib web application.
2
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
143 </p>
3
9a472dab7e09 more new documentation
robcast
parents: 2
diff changeset
144 <p>But there are classloader issues. Newer versions of Tomcat refuse to load
9a472dab7e09 more new documentation
robcast
parents: 2
diff changeset
145 the libraries and I found that in some cases digilib stopped reading TIFF files
9a472dab7e09 more new documentation
robcast
parents: 2
diff changeset
146 after a period of running.</p>
9a472dab7e09 more new documentation
robcast
parents: 2
diff changeset
147 <p>
9a472dab7e09 more new documentation
robcast
parents: 2
diff changeset
148 In these cases it helped to install the JAI files in Tomcats <code>lib/</code>
9a472dab7e09 more new documentation
robcast
parents: 2
diff changeset
149 directory or Jettys <code>lib/ext/</code> or globally in the local Java JDK
9a472dab7e09 more new documentation
robcast
parents: 2
diff changeset
150 installation (i.e. in the Java's /jre/lib/ext/ directory on linux).
9a472dab7e09 more new documentation
robcast
parents: 2
diff changeset
151 </p>
2
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
152
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
153
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
154 <h1 id="mpiwg_setup">Sample setup</h1>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
155
3
9a472dab7e09 more new documentation
robcast
parents: 2
diff changeset
156 <p>The current digilib setup at the MPIWG (as of December 2010):</p>
2
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
157 <ul>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
158 <li>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
159 One frontend server running the lightweight web-multiplexer <a
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
160 href="http://www.apsis.ch/pound/" class="external text" rel="nofollow">pound</a>
3
9a472dab7e09 more new documentation
robcast
parents: 2
diff changeset
161 on port 80 that distributes requests to three servers runnning digilib
2
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
162 </li>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
163 <li>
3
9a472dab7e09 more new documentation
robcast
parents: 2
diff changeset
164 the three servers run digilib under <a
9a472dab7e09 more new documentation
robcast
parents: 2
diff changeset
165 href="http://www.eclipse.org/jetty/" class="external text"
9a472dab7e09 more new documentation
robcast
parents: 2
diff changeset
166 rel="nofollow">Jetty</a> on port 8080 without Apache
2
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
167 <ul>
3
9a472dab7e09 more new documentation
robcast
parents: 2
diff changeset
168 <li>one server is the frontend server (Linux 32bit, Dual
2
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
169 2.4GHz Xeon, 2GB RAM)</li>
3
9a472dab7e09 more new documentation
robcast
parents: 2
diff changeset
170 <li>the other server is a separate, newer machine (Linux 64bit, Dual 1.8GHz
2
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
171 Opteron, 2GB RAM)</li>
3
9a472dab7e09 more new documentation
robcast
parents: 2
diff changeset
172 <li>the third server is a separate, newer machine (Linux 32bit, Dual 2.8GHz
9a472dab7e09 more new documentation
robcast
parents: 2
diff changeset
173 Xeon, 4GB RAM)</li>
2
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
174 </ul>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
175 </li>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
176 <li>
3
9a472dab7e09 more new documentation
robcast
parents: 2
diff changeset
177 the digilib instances (digilib 2.0b1 as of 12.12.2011) run on Jetty 8.0.4 on Java
9a472dab7e09 more new documentation
robcast
parents: 2
diff changeset
178 1.6.0_26 with 1GB of <a href="#vm_settings">Java VM memory
9a472dab7e09 more new documentation
robcast
parents: 2
diff changeset
179 for digilib</a> (-Xmx1024m) with JAI (1.1.3) and JAI-ImageIO (1.1) <a
9a472dab7e09 more new documentation
robcast
parents: 2
diff changeset
180 href="#installing_jai">installed in the Jetty/lib/ext</a>(!)
2
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
181 </li>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
182 <li>both digilib servers access all image files over NFS (over GBit
3
9a472dab7e09 more new documentation
robcast
parents: 2
diff changeset
183 Ethernet) from a central file server (Solaris 10, Sun Fire 240, multiple RAIDs
2
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
184 on Fibrechannel)</li>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
185 </ul>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
186
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
187 </td>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
188 </tr>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
189 <tr>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
190 <td style="padding: 0px" align="left">
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
191 <a href="http://developer.berlios.de"> <img
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
192 src="http://developer.berlios.de/bslogo.php?group_id=0&type=1" width="124"
3
9a472dab7e09 more new documentation
robcast
parents: 2
diff changeset
193 height="32" border="0" alt="BerliOS Logo" />
9a472dab7e09 more new documentation
robcast
parents: 2
diff changeset
194 </a>
2
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
195 </td>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
196 <td></td>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
197 </tr>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
198 </table>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
199
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
200 </body>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
201 </html>