github.com/kaydxh/golang@v0.0.131/pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/batch.html (about) 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 2 "http://www.w3.org/TR/html4/loose.dtd"> 3 <html> 4 <head> 5 <meta HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=us-ascii"> 6 <title>GraphicsMagick GM Utility</title> 7 <style type=text/css> 8 <!-- 9 @page { size: 8.5in 11in } 10 TD P { color: #000000; font-family: "Verdana", "Arial", "Helvetica", sans-serif; font-size: 12pt } 11 P { color: #000000; font-family: "Verdana", "Arial", "Helvetica", sans-serif; font-size: 12pt } 12 A:link { color: #00B04F } 13 A:visited { color: #007B37 } 14 --> 15 </style> 16 17 </head> 18 <body LANG="en-US" TEXT="#000000" LINK="#00B04F" VLINK="#007B37" BGCOLOR="#ffffff"> 19 <a name="top"></a> 20 <table border=0 cellpadding=10 cellspacing=0 style="margin-top:-17px" width="100%"><tr><td> 21 <br> <br> 22 <table BORDER=0 WIDTH="100%"> 23 <tr> 24 <td ALIGN=LEFT bgcolor="#FFFFFF"><img 25 SRC="images/right_triangle.png" ALT=">" BORDER=0 26 height=14 width=15><b><font face="Helvetica, Arial"><font 27 color="#00B04F"><font size="+1"> 28 <a NAME="batch"></a>gm batch 29 </font></font></font></b></td></tr></table> 30 <table width="94%" border="0" cellspacing="0" cellpadding="8"> 31 <tr><td width="3%"><br></td><td> 32 <table BORDER=0 WIDTH="100%"> 33 <tr> 34 <td ALIGN=LEFT bgcolor="#FFFFFF"><img 35 SRC="images/right_triangle.png" ALT=">" BORDER=0 36 height=14 width=15><b><font face="Helvetica, Arial"><font 37 color="#00B04F"><font size="+1"> 38 <a NAME="batch-top"></a>NAME 39 </font></font></font></b></td></tr></table> 40 <table width="94%" border="0" cellspacing="0" cellpadding="8"> 41 <tr><td width="3%"><br></td><td> 42 batch - execute multiple gm commands as a script 43 </td></tr></table> 44 <table BORDER=0 WIDTH="100%"> 45 <tr> 46 <td ALIGN=LEFT bgcolor="#FFFFFF"><img 47 SRC="images/right_triangle.png" ALT=">" BORDER=0 48 height=14 width=15><b><font face="Helvetica, Arial"><font 49 color="#00B04F"><font size="+1"> 50 <a NAME="batch-contents"></a>Contents 51 </font></font></font></b></td></tr></table> 52 <table width="94%" border="0" cellspacing="0" cellpadding="8"> 53 <tr><td width="3%"><br></td><td> 54 <dl> 55 <dt> 56 <a href="#batch-syno">Synopsis</a> 57 </dt> 58 <dt> 59 <a href="#batch-desc">Description</a> 60 </dt> 61 <dt> 62 <a href="#batch-exam">Examples</a> 63 </dt> 64 <dt> 65 <a href="#batch-opti">Options</a> 66 </dt> 67 </dl> 68 </td></tr></table> 69 <table BORDER=0 WIDTH="100%"> 70 <tr> 71 <td ALIGN=LEFT bgcolor="#FFFFFF"><img 72 SRC="images/right_triangle.png" ALT=">" BORDER=0 73 height=14 width=15><b><font face="Helvetica, Arial"><font 74 color="#00B04F"><font size="+1"> 75 <a NAME="batch-syno"></a>Synopsis 76 </font></font></font></b></td></tr></table> 77 <table width="94%" border="0" cellspacing="0" cellpadding="8"> 78 <tr><td width="3%"><br></td><td> 79 <p> 80 <strong>gm batch</strong> <strong>[</strong> <em>options ...</em> <strong>]</strong> <strong>[</strong> <em>script</em> <strong>]</strong> 81 </td></tr></table> 82 <table BORDER=0 WIDTH="100%"> 83 <tr> 84 <td ALIGN=LEFT bgcolor="#FFFFFF"><img 85 SRC="images/right_triangle.png" ALT=">" BORDER=0 86 height=14 width=15><b><font face="Helvetica, Arial"><font 87 color="#00B04F"><font size="+1"> 88 <a NAME="batch-desc"></a>Description 89 </font></font></font></b></td></tr></table> 90 <table width="94%" border="0" cellspacing="0" cellpadding="8"> 91 <tr><td width="3%"><br></td><td> 92 <p> 93 <strong>batch</strong> executes an arbitary number of the utility commands 94 (e.g. <strong>convert</strong>) in the form of a simple linear batch script in 95 order to improve execution efficiency, and/or to allow use as a 96 subordinate co-process under the control of an arbitrary script or 97 program. 98 </td></tr></table> 99 <table BORDER=0 WIDTH="100%"> 100 <tr> 101 <td ALIGN=LEFT bgcolor="#FFFFFF"><img 102 SRC="images/right_triangle.png" ALT=">" BORDER=0 103 height=14 width=15><b><font face="Helvetica, Arial"><font 104 color="#00B04F"><font size="+1"> 105 <a NAME="batch-exam"></a>Examples 106 </font></font></font></b></td></tr></table> 107 <table width="94%" border="0" cellspacing="0" cellpadding="8"> 108 <tr><td width="3%"><br></td><td> 109 <p> To drive <strong>'gm batch'</strong> using a shell script (or a program 110 written in any language), have the script/program send commands to 'gm 111 batch' via its standard input. Specify that standard input should be 112 used by using <strong>'-'</strong> as the file name. The following example 113 converts all files matching '*.jpg' to TIFF format while rotating each 114 file by 90 degrees and stripping all embedded profiles. The shell 115 script syntax is standard Unix shell: 116 <pre> 117 for file in *.jpg 118 do 119 outfile=`basename $file .jpg`.tiff 120 echo convert -verbose "'$file'" -rotate 90 \ 121 +profile "'*'" "'$outfile'" 122 done | gm batch -echo on -feedback on - 123 </pre> 124 <p> 125 We can accomplish the same as the previous example by putting all the 126 commands in a text file and then specifying the name of the text file 127 as the script to execute: 128 <pre> 129 for file in *.jpg 130 do 131 outfile=`basename $file .jpg`.tiff 132 echo convert -verbose "'$file'" -rotate 90 \ 133 +profile "'*'" "'$outfile'" 134 done > script.txt 135 gm batch -echo on -feedback on script.txt 136 </pre> 137 </td></tr></table> 138 <p> 139 <i><a href="#top">Back to Contents</a></i> 140 </p> 141 <table BORDER=0 WIDTH="100%"> 142 <tr> 143 <td ALIGN=LEFT bgcolor="#FFFFFF"><img 144 SRC="images/right_triangle.png" ALT=">" BORDER=0 145 height=14 width=15><b><font face="Helvetica, Arial"><font 146 color="#00B04F"><font size="+1"> 147 <a NAME="batch-opti"></a>Options 148 </font></font></font></b></td></tr></table> 149 <table width="94%" border="0" cellspacing="0" cellpadding="8"> 150 <tr><td width="3%"><br></td><td> 151 <p> 152 Options are processed from left to right and must appear before any filename argument. 153 <table BORDER=0 WIDTH="94%"> 154 <tr> 155 <td width="3%"><br></td> 156 <td ALIGN=LEFT BGCOLOR="#FFFFFF"> 157 <img SRC="images/right_triangle_option.png" 158 ALT=">" BORDER=0 height=14 159 width=15><b><font face="Helvetica, Arial" 160 ><font color="#00B04F"><font size="+1"> 161 -echo <i>on|off</i> 162 </font></font></font></b></td></tr></table> 163 <table width="90%" border="0" cellspacing="0" cellpadding="8"> <tr><td width="6%"><br></td><td>command echo on or off</td></tr></table> 164 <p> 165 Specify <strong>on</strong> to enable echoing commands to standard output as 166 they are read or <strong>off</strong> to disable. The default is 167 <strong>off</strong>. 168 <table BORDER=0 WIDTH="94%"> 169 <tr> 170 <td width="3%"><br></td> 171 <td ALIGN=LEFT BGCOLOR="#FFFFFF"> 172 <img SRC="images/right_triangle_option.png" 173 ALT=">" BORDER=0 height=14 174 width=15><b><font face="Helvetica, Arial" 175 ><font color="#00B04F"><font size="+1"> 176 -escape <i>unix|windows</i> 177 </font></font></font></b></td></tr></table> 178 <table width="90%" border="0" cellspacing="0" cellpadding="8"> <tr><td width="6%"><br></td><td>Parse using unix or windows syntax</td></tr></table> 179 <p> 180 Commands must be parsed from the input stream and escaping needs to be 181 used to protect spaces or quoting characters in the input. Specify 182 <strong>unix</strong> to use unix-style command line parsing or <strong>windows</strong> 183 for Microsoft Windows command shell style parsing. The default depends 184 on if the software is compiled for Microsoft Windows or for a 185 Unix-type system (including Cygwin on Microsoft Windows). It is 186 recommended to use unix syntax because it is more powerful and more 187 portable. 188 <table BORDER=0 WIDTH="94%"> 189 <tr> 190 <td width="3%"><br></td> 191 <td ALIGN=LEFT BGCOLOR="#FFFFFF"> 192 <img SRC="images/right_triangle_option.png" 193 ALT=">" BORDER=0 height=14 194 width=15><b><font face="Helvetica, Arial" 195 ><font color="#00B04F"><font size="+1"> 196 -fail <i>text</i> 197 </font></font></font></b></td></tr></table> 198 <table width="90%" border="0" cellspacing="0" cellpadding="8"> <tr><td width="6%"><br></td><td>text to print if a command fails</td></tr></table> 199 <p> 200 When feedback is enabled, this specifies the text to print when the 201 command fails. The default text is <strong>FAIL</strong>. 202 <table BORDER=0 WIDTH="94%"> 203 <tr> 204 <td width="3%"><br></td> 205 <td ALIGN=LEFT BGCOLOR="#FFFFFF"> 206 <img SRC="images/right_triangle_option.png" 207 ALT=">" BORDER=0 height=14 208 width=15><b><font face="Helvetica, Arial" 209 ><font color="#00B04F"><font size="+1"> 210 -feedback <i>on|off</i> 211 </font></font></font></b></td></tr></table> 212 <table width="90%" border="0" cellspacing="0" cellpadding="8"> <tr><td width="6%"><br></td><td>enable error feedback</td></tr></table> 213 <p> 214 Print text (see -pass and -fail options) feedback after each 215 command to indicate the result, the default is <strong>off</strong>. 216 <table BORDER=0 WIDTH="94%"> 217 <tr> 218 <td width="3%"><br></td> 219 <td ALIGN=LEFT BGCOLOR="#FFFFFF"> 220 <img SRC="images/right_triangle_option.png" 221 ALT=">" BORDER=0 height=14 222 width=15><b><font face="Helvetica, Arial" 223 ><font color="#00B04F"><font size="+1"> 224 -help 225 </font></font></font></b></td></tr></table> 226 <p> 227 Prints batch command help. 228 <table BORDER=0 WIDTH="94%"> 229 <tr> 230 <td width="3%"><br></td> 231 <td ALIGN=LEFT BGCOLOR="#FFFFFF"> 232 <img SRC="images/right_triangle_option.png" 233 ALT=">" BORDER=0 height=14 234 width=15><b><font face="Helvetica, Arial" 235 ><font color="#00B04F"><font size="+1"> 236 -pass <i>text</i> 237 </font></font></font></b></td></tr></table> 238 <table width="90%" border="0" cellspacing="0" cellpadding="8"> <tr><td width="6%"><br></td><td>text to print if a command passes</td></tr></table> 239 <p> 240 When feedback is enabled, this specifies the text to print when the 241 command passes. The default text is <strong>PASS</strong>. 242 <table BORDER=0 WIDTH="94%"> 243 <tr> 244 <td width="3%"><br></td> 245 <td ALIGN=LEFT BGCOLOR="#FFFFFF"> 246 <img SRC="images/right_triangle_option.png" 247 ALT=">" BORDER=0 height=14 248 width=15><b><font face="Helvetica, Arial" 249 ><font color="#00B04F"><font size="+1"> 250 -prompt <i>text</i> 251 </font></font></font></b></td></tr></table> 252 <table width="90%" border="0" cellspacing="0" cellpadding="8"> <tr><td width="6%"><br></td><td>Prompt text to use for command line</td></tr></table> 253 <p> 254 If no filename argument was specified, a simple command prompt appears 255 where you may enter GraphicsMagick commands. The default prompt is 256 <strong>GM></strong>. Use this option to change the prompt to something else. 257 <table BORDER=0 WIDTH="94%"> 258 <tr> 259 <td width="3%"><br></td> 260 <td ALIGN=LEFT BGCOLOR="#FFFFFF"> 261 <img SRC="images/right_triangle_option.png" 262 ALT=">" BORDER=0 height=14 263 width=15><b><font face="Helvetica, Arial" 264 ><font color="#00B04F"><font size="+1"> 265 -stop-on-error <i>on|off</i> 266 </font></font></font></b></td></tr></table> 267 <table width="90%" border="0" cellspacing="0" cellpadding="8"> <tr><td width="6%"><br></td><td>Specify if command processing stops on error</td></tr></table> 268 <p> 269 Normally command processing continues if a command encounters an 270 error. Specify <strong>-stop-on-error on</strong> to cause processing to quit 271 immediately on error. 272 </td></tr></table> 273 <p> 274 <i><a href="#top">Back to Contents</a></i> 275 </p> 276 </td></tr></table>