|
0
|
1 <tool id="graphicsmagick_image_processing" name="Image Converter" version="0.1.0">
|
|
|
2 <description></description>
|
|
|
3 <requirements>
|
|
|
4 <requirement type="package" version="1.3.18">graphicsmagick</requirement>
|
|
|
5 </requirements>
|
|
|
6 <command>
|
|
2
|
7 <![CDATA[
|
|
0
|
8 ln -s '${input}' input.${input.ext};
|
|
|
9 #set $trans_options = str($transformations).replace(',', ' ')
|
|
|
10
|
|
|
11 convert $trans_options input.${input.ext} temp.${output_format};
|
|
|
12 mv temp.${output_format} '${output}';
|
|
2
|
13 ]]>
|
|
0
|
14 </command>
|
|
|
15
|
|
|
16 <inputs>
|
|
|
17 <param format="jpg,png,bmp,gif,svg,eps,tiff,xcf" name="input" type="data" label="Image to convert" />
|
|
|
18 <param name="transformations" multiple="true" type="select" display="checkboxes" label="Transformations">
|
|
|
19 <option value="-flip">flip vertically</option>
|
|
|
20 <option value="-flop">flip horizontally</option>
|
|
|
21 <option value="-rotate 90">rotate 90 degree to the right</option>
|
|
|
22 <option value="-rotate 270">rotate 90 degree to the left</option>
|
|
|
23 <option value="-rotate 180">rotate 180 degree</option>
|
|
|
24 </param>
|
|
|
25 <param name="output_format" type="select" label="Output Format">
|
|
|
26 <option value="jpeg">jpg</option>
|
|
|
27 <option value="png">png</option>
|
|
|
28 <option value="bmp">bmp</option>
|
|
|
29 <option value="gif">gif</option>
|
|
|
30 <option value="svg">svg</option>
|
|
|
31 <option value="eps">eps</option>
|
|
|
32 <option value="tiff">tiff</option>
|
|
2
|
33 </param>
|
|
0
|
34 </inputs>
|
|
|
35 <outputs>
|
|
|
36 <data format="png" name="output">
|
|
|
37 <change_format>
|
|
|
38 <when input="output_format" value="jpeg" format="jpg" />
|
|
|
39 <when input="output_format" value="png" format="png" />
|
|
|
40 <when input="output_format" value="bmp" format="bmp" />
|
|
|
41 <when input="output_format" value="gif" format="gif" />
|
|
|
42 <when input="output_format" value="svg" format="svg" />
|
|
|
43 <when input="output_format" value="eps" format="eps" />
|
|
|
44 <when input="output_format" value="tiff" format="tiff" />
|
|
|
45 </change_format>
|
|
|
46 </data>
|
|
|
47 </outputs>
|
|
|
48 <tests>
|
|
|
49 <test>
|
|
|
50 <param name="input" value="donald.jpg" />
|
|
|
51 <output name="output" file="donald.png" compare="sim_size" />
|
|
|
52 <param name="output_format" value="png" />
|
|
|
53 <param name="transformations" value="-flip" />
|
|
|
54 </test>
|
|
|
55
|
|
|
56 </tests>
|
|
|
57 <help>
|
|
2
|
58 <![CDATA[
|
|
0
|
59
|
|
|
60 **What it does**
|
|
|
61
|
|
|
62 This tool converts an image into another format. You can also do some transformations like flipping or rotating.
|
|
|
63 Here you can see, how -flip behaves:
|
|
|
64
|
|
|
65 Input:
|
|
|
66
|
|
1
|
67 .. image:: $PATH_TO_IMAGES/donald.jpg
|
|
0
|
68
|
|
|
69 Output:
|
|
|
70
|
|
1
|
71 .. image:: $PATH_TO_IMAGES/donald.png
|
|
|
72
|
|
2
|
73 ]]>
|
|
1
|
74 </help>
|
|
0
|
75 </tool>
|