You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

image.html 6.8 KiB

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