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