annotate website/tips.html @ 2:8abbc40d0df5

slightly updated website. removed links to berlios wiki, made tips page instead. still quite ugly...
author robcast
date Fri, 09 Dec 2011 20:33:24 +0100
parents
children 9a472dab7e09
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>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
15 <tt>digilib</tt>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
16 -- a versatile image viewing environment for the internet
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
17 </h1>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
18 </td>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
19 </tr>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
20 <tr>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
21 <td bgcolor="#a0a0a0" valign="top" align="right">
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
22 <p>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
23 <b><a href="index.html">Info</a>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
24 </b>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
25 </p>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
26 <p>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
27 <b><a href="http://developer.berlios.de/projects/digilib/">Project</a>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
28 </b>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
29 </p>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
30 <p>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
31 <b><a href="http://developer.berlios.de/project/showfiles.php?group_id=251">Download</a>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
32 </b>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
33 </p>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
34 <p>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
35 <b><a href="http://developer.berlios.de/docman/?group_id=251">Docs</a>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
36 </b>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
37 </p>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
38 <p>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
39 <b><a href="tips.html">Tips</a>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
40 </b>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
41 </p>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
42 <p>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
43 <b><a href="http://hg.berlios.de/repos/digilib">Source</a>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
44 </b>
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>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
59 <a href="installing_jai">Installing JAI</a>
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>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
137 In principle you can install the <a
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
138 href="http://java.sun.com/javase/technologies/desktop/media/jai/"
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
139 class="external text" rel="nofollow">Java Advanced Imaging</a> JAR files (and
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
140 native library files if available) in the /WEB-INF/lib/ directory of the digilib
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
141 web application.
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
142
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
143 </p>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
144 <p>I found that in some cases digilib stopped reading TIFF files after a
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
145 period of running. In these cases it helped to install the JAI files directly in
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
146 the local Java installation (i.e. in the Java's /jre/lib/ext/ directory on
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
147 linux).</p>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
148
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
149
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
150 <h1 id="mpiwg_setup">Sample setup</h1>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
151
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
152 <p>The current digilib setup at the MPIWG (as of November 2005):</p>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
153 <ul>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
154 <li>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
155 One frontend server running the lightweight web-multiplexer <a
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
156 href="http://www.apsis.ch/pound/" class="external text" rel="nofollow">pound</a>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
157 on port 80 that distributes requests to two servers runnning digilib
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
158 </li>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
159 <li>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
160 the two servers run digilib under <a
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
161 href="http://tomcat.apache.org/index.html" class="external text"
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
162 rel="nofollow">Tomcat</a> on port 8080 without Apache
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
163 <ul>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
164 <li>one server is the same machine as the frontend server (Linux, Dual
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
165 2.4GHz Xeon, 2GB RAM)</li>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
166 <li>the other server is a separate, newer machine (Linux, Dual 1.8GHz
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
167 Opteron, 2GB RAM)</li>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
168 </ul>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
169 </li>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
170 <li>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
171 the digilib instances (digilib 1.5.9c as of 22.11.2005) run on Tomcat on Java
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
172 1.5.0_05 (or 1.4.2_06) with 1GB of <a href="#vm_settings">Java VM memory
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
173 for digilib</a> (-Xmx1024m) with JAI (1.1.2_01) and JAI-ImageIO (1.0_01) <a
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
174 href="#installing_jai">installed in the JRE</a>(!)
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
175 </li>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
176 <li>both digilib servers access all image files over NFS (over GBit
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
177 Ethernet) from a central file server (Solaris 8, Sun Fire 480, multiple RAIDs
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
178 on Fibrechannel)</li>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
179 </ul>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
180
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
181 </td>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
182 </tr>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
183 <tr>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
184 <td style="padding: 0px" align="left">
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
185 <a href="http://developer.berlios.de"> <img
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
186 src="http://developer.berlios.de/bslogo.php?group_id=0&type=1" width="124"
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
187 height="32" border="0" alt="BerliOS Logo" /> </a>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
188 </td>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
189 <td></td>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
190 </tr>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
191 </table>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
192
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
193 </body>
8abbc40d0df5 slightly updated website.
robcast
parents:
diff changeset
194 </html>