1 | <!--
|
---|
2 | Licensed to the Apache Software Foundation (ASF) under one or more
|
---|
3 | contributor license agreements. See the NOTICE file distributed with
|
---|
4 | this work for additional information regarding copyright ownership.
|
---|
5 | The ASF licenses this file to You under the Apache License, Version 2.0
|
---|
6 | (the "License"); you may not use this file except in compliance with
|
---|
7 | the License. You may obtain a copy of the License at
|
---|
8 |
|
---|
9 | http://www.apache.org/licenses/LICENSE-2.0
|
---|
10 |
|
---|
11 | Unless required by applicable law or agreed to in writing, software
|
---|
12 | distributed under the License is distributed on an "AS IS" BASIS,
|
---|
13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
---|
14 | See the License for the specific language governing permissions and
|
---|
15 | limitations under the License.
|
---|
16 | -->
|
---|
17 | <html>
|
---|
18 |
|
---|
19 | <head>
|
---|
20 | <meta http-equiv="Content-Language" content="en-us">
|
---|
21 | <link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
|
---|
22 | <title>Image Task</title>
|
---|
23 | </head>
|
---|
24 |
|
---|
25 | <body>
|
---|
26 |
|
---|
27 | <h2><a name="image">Image</a></h2>
|
---|
28 | <h3>Description</h3>
|
---|
29 | <p>Applies a chain of image operations on a set of files.</p>
|
---|
30 | <p>Requires Java Advanced Image API from Sun.</p>
|
---|
31 |
|
---|
32 | <h5>Overview of used datatypes</h5>
|
---|
33 | <img src="image-classdiagram.gif" border="0" alt="Class-Diagram">
|
---|
34 |
|
---|
35 | <h3>Parameters</h3>
|
---|
36 | <table border="1" cellpadding="2" cellspacing="0">
|
---|
37 | <tr>
|
---|
38 | <td valign="top"><b>Attribute</b></td>
|
---|
39 | <td valign="top"><b>Description</b></td>
|
---|
40 | <td align="center" valign="top"><b>Required</b></td>
|
---|
41 | </tr>
|
---|
42 | <tr>
|
---|
43 | <td valign="top"> failonerror </td>
|
---|
44 | <td valign="top"> Boolean value. If false, note errors to the output but keep going. </td>
|
---|
45 | <td align="center"> no (defaults to <i>true</i>) </td>
|
---|
46 | </tr>
|
---|
47 | <tr>
|
---|
48 | <td valign="top"> srcdir </td>
|
---|
49 | <td valign="top"> Directory containing the images. </td>
|
---|
50 | <td align="center"> yes, unless nested fileset is used </td>
|
---|
51 | </tr>
|
---|
52 | <tr>
|
---|
53 | <td valign="top"> encoding </td>
|
---|
54 | <td valign="top"> Image encoding type. <br>
|
---|
55 | Valid (caseinsensitive) are: jpg, jpeg, tif, tiff
|
---|
56 | </td>
|
---|
57 | <td align="center"> no (defaults to <i>JPEG</i>) </td>
|
---|
58 | </tr>
|
---|
59 | <tr>
|
---|
60 | <td valign="top"> overwrite </td>
|
---|
61 | <td valign="top"> Boolean value. Sets whether or not to overwrite
|
---|
62 | a file if there is naming conflict.
|
---|
63 | </td>
|
---|
64 | <td align="center"> no (defaults to <i>false</i>) </td>
|
---|
65 | </tr>
|
---|
66 | <tr>
|
---|
67 | <td valign="top"> gc </td>
|
---|
68 | <td valign="top"> Boolean value. Enables garbage collection after
|
---|
69 | each image processed.
|
---|
70 | </td>
|
---|
71 | <td align="center"> no (defaults to <i>false</i>) </td>
|
---|
72 | </tr>
|
---|
73 | <tr>
|
---|
74 | <td valign="top"> destdir </td>
|
---|
75 | <td valign="top"> Directory where the result images are stored. </td>
|
---|
76 | <td align="center"> no (defaults to value of <i>srcdir</i>) </td>
|
---|
77 | </tr>
|
---|
78 | <!-- attributes inherited from MatchingTask -->
|
---|
79 | <tr>
|
---|
80 | <td valign="top">includes</td>
|
---|
81 | <td valign="top">comma- or space-separated list of patterns of files that must be
|
---|
82 | included. All files are included when omitted.</td>
|
---|
83 | <td valign="top" align="center">No</td>
|
---|
84 | </tr>
|
---|
85 | <tr>
|
---|
86 | <td valign="top">includesfile</td>
|
---|
87 | <td valign="top">the name of a file. Each line of this file is
|
---|
88 | taken to be an include pattern</td>
|
---|
89 | <td valign="top" align="center">No</td>
|
---|
90 | </tr>
|
---|
91 | <tr>
|
---|
92 | <td valign="top"> excludes</td>
|
---|
93 | <td valign="top">comma- or space-separated list of patterns of files that must be
|
---|
94 | excluded. No files (except default excludes) are excluded when omitted.</td>
|
---|
95 | <td valign="top" align="center">No</td>
|
---|
96 | </tr>
|
---|
97 | <tr>
|
---|
98 | <td valign="top">excludesfile</td>
|
---|
99 | <td valign="top">the name of a file. Each line of this file is
|
---|
100 | taken to be an exclude pattern</td>
|
---|
101 | <td valign="top" align="center">No</td>
|
---|
102 | </tr>
|
---|
103 | <tr>
|
---|
104 | <td valign="top">defaultexcludes</td>
|
---|
105 | <td valign="top">indicates whether default excludes should be used or not
|
---|
106 | ("yes"/"no"). Default excludes are used when omitted.</td>
|
---|
107 | <td valign="top" align="center">No</td>
|
---|
108 | </tr>
|
---|
109 | <tr>
|
---|
110 | <td valign="top"> caseSensitive </td>
|
---|
111 | <td valign="top"> Boolean value. Sets case sensitivity of the file system. </td>
|
---|
112 | <td align="center"> no (defaults to <i>false</i>) </td>
|
---|
113 | </tr>
|
---|
114 | <tr>
|
---|
115 | <td valign="top"> followSymlinks </td>
|
---|
116 | <td valign="top"> Boolean value. Sets whether or not symbolic links should be followed. </td>
|
---|
117 | <td align="center"> no (defaults to <i>true</i>) </td>
|
---|
118 | </tr>
|
---|
119 | </table>
|
---|
120 |
|
---|
121 | <h3>Parameters specified as nested elements</h3>
|
---|
122 | <p>This task forms an implicit <a href="../CoreTypes/fileset.html">FileSet</a> and
|
---|
123 | supports all attributes of <code><fileset></code> as well as the
|
---|
124 | nested <code><include></code>, <code><exclude></code> and
|
---|
125 | <code><patternset></code> elements.</p>
|
---|
126 |
|
---|
127 |
|
---|
128 | <h4>ImageOperation</h4>
|
---|
129 | <p>Adds an ImageOperation to chain.</p>
|
---|
130 | <h5>Nested Elements</h5>
|
---|
131 | ImageOperation can handle nested Rotate, Draw, Rectangle, Text and Scale objects.
|
---|
132 |
|
---|
133 | <h4>Rotate</h4>
|
---|
134 | <p>Adds a Rotate ImageOperation to chain.</p>
|
---|
135 | <h5>Parameters</h5>
|
---|
136 | <table border="1" cellpadding="2" cellspacing="0">
|
---|
137 | <tr>
|
---|
138 | <td valign="top"><b>Attribute</b></td>
|
---|
139 | <td valign="top"><b>Description</b></td>
|
---|
140 | <td align="center" valign="top"><b>Required</b></td>
|
---|
141 | </tr>
|
---|
142 | <tr>
|
---|
143 | <td valign="top"> angle </td>
|
---|
144 | <td valign="top"> Float value. Sets the angle of rotation in degrees. </td>
|
---|
145 | <td align="center"> no (defaults to <i>0.0F</i>) </td>
|
---|
146 | </tr>
|
---|
147 | </table>
|
---|
148 |
|
---|
149 | <h4>Scale</h4>
|
---|
150 | <p>Adds a Scale ImageOperation to chain.</p>
|
---|
151 | <h5>Parameters</h5>
|
---|
152 | <table border="1" cellpadding="2" cellspacing="0">
|
---|
153 | <tr>
|
---|
154 | <td valign="top"><b>Attribute</b></td>
|
---|
155 | <td valign="top"><b>Description</b></td>
|
---|
156 | <td align="center" valign="top"><b>Required</b></td>
|
---|
157 | </tr>
|
---|
158 | <td valign="top"> proportions </td>
|
---|
159 | <td valign="top"> Sets which dimension to control proportions from. Valid values are:<ul>
|
---|
160 | <li>"ignore" - treat the dimensions independently.</li>
|
---|
161 | <li>"height" - keep proportions based on the width.</li>
|
---|
162 | <li>"width" - keep proportions based on the height.</li>
|
---|
163 | <li>"cover" - keep proportions and fit in the supplied dimensions.</li>
|
---|
164 | <li>"fit" - keep proportions and cover the supplied dimensions.</li>
|
---|
165 | </ul></td>
|
---|
166 | <td align="center"> no (defaults to <i>ignore</i>) </td>
|
---|
167 | <tr>
|
---|
168 | <td valign="top"> width </td>
|
---|
169 | <td valign="top"> Sets the width of the image, either as an integer or a %. </td>
|
---|
170 | <!-- todo: if integer, what kind? cm, px, inches, ... -->
|
---|
171 | <td align="center"> no (defaults to <i>100%</i>) </td>
|
---|
172 | </tr>
|
---|
173 | <tr>
|
---|
174 | <td valign="top"> height </td>
|
---|
175 | <td valign="top"> Sets the height of the image, either as an integer or a %. </td>
|
---|
176 | <!-- todo: if integer, what kind? cm, px, inches, ... -->
|
---|
177 | <td align="center"> no (defaults to <i>100%</i>) </td>
|
---|
178 | </tr>
|
---|
179 | </table>
|
---|
180 |
|
---|
181 | <h4>Draw</h4>
|
---|
182 | <p>Adds a Draw ImageOperation to chain. DrawOperation DataType objects can be
|
---|
183 | nested inside the Draw object.</p>
|
---|
184 | <h5>Parameters</h5>
|
---|
185 | <table border="1" cellpadding="2" cellspacing="0">
|
---|
186 | <tr>
|
---|
187 | <td valign="top"><b>Attribute</b></td>
|
---|
188 | <td valign="top"><b>Description</b></td>
|
---|
189 | <td align="center" valign="top"><b>Required</b></td>
|
---|
190 | </tr>
|
---|
191 | <tr>
|
---|
192 | <td valign="top"> xloc </td>
|
---|
193 | <td valign="top"> X-Position where to draw nested image elements. </td>
|
---|
194 | <td align="center"> no (defaults to <i>0</i>) </td>
|
---|
195 | </tr>
|
---|
196 | <tr>
|
---|
197 | <td valign="top"> yloc </td>
|
---|
198 | <td valign="top"> Y-Position where to draw nested image elements. </td>
|
---|
199 | <td align="center"> no (defaults to <i>0</i>) </td>
|
---|
200 | </tr>
|
---|
201 | </table>
|
---|
202 |
|
---|
203 | <h3>Examples</h3>
|
---|
204 |
|
---|
205 | <blockquote><pre>
|
---|
206 | <image destdir="samples/low" overwrite="yes">
|
---|
207 | <fileset dir="samples/full">
|
---|
208 | <include name="**/*.jpg"/>
|
---|
209 | </fileset>
|
---|
210 | <scale width="160" height="160" proportions="fit"/>
|
---|
211 | </image>
|
---|
212 | </pre></blockquote>
|
---|
213 | <p>Create thumbnails of my images and make sure they all fit within the 160x160 size whether the
|
---|
214 | image is portrait or landscape.</p>
|
---|
215 |
|
---|
216 | <blockquote><pre>
|
---|
217 | <image srcdir="src" includes="*.png">
|
---|
218 | <scale proportions="width" width="40"/>
|
---|
219 | </image>
|
---|
220 | </pre></blockquote>
|
---|
221 | <p>Creates a thumbnail for all PNG-files in <i>src</i> in the size of 40 pixel keeping the proportions
|
---|
222 | and stores the <i>src</i>.</p>
|
---|
223 |
|
---|
224 | <blockquote><pre>
|
---|
225 | <image srcdir="src" destdir="dest" includes="*.png">
|
---|
226 | <scale proportions="width" width="40"/>
|
---|
227 | </image>
|
---|
228 | </pre></blockquote>
|
---|
229 | <p>Same as above but stores the result in <i>dest</i>.</p>
|
---|
230 |
|
---|
231 | <blockquote><pre>
|
---|
232 | </pre></blockquote>
|
---|
233 |
|
---|
234 |
|
---|
235 |
|
---|
236 | </body>
|
---|
237 | </html>
|
---|
238 |
|
---|
239 |
|
---|