Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Rename and edit ImageMagick_convert.sh script to wrap your conversion tool. This script file should be named in the format <alias>_convert.<script_type>. Here <alias> needs to be replaced by the name of the conversion tool with which the converter registers with Polyglot and <script_type> needs to be replaced by the extension for the type of script this wrapper is written in.  Polyglot currently supports scripts written in Python, Bash, R, AutoHotKey, AutoIT, and Sikuli (e.g. *.py, *.sh, etc.). For the sake of ease of explanation, we will rename the script file as MyTool_convert.sh. This script accepts three parameters: 

  1. Full path to input file
  2. Full path to output file (including filename)
  3. Full local path to available scratch space (optional)

This script will be used by the Software Server to run the tool and carry out any requested conversions. The example script ImageMagick_convert.sh that uses ImageMagick tool to convert images between different formats is shown below. The conversion script follows a specific header and is written as comments:

  1. First line is the shebang line
  2. Second line contains the name of the converter followed by the version if any
  3. Third line refers to the type of the data that it can convert
  4. Fourth line contains a comma-separated list of input file formats accepted by this converter
  5. Fifth line contains a comma-separated list of output file formats that this converter can generate
  6. This is followed by the actual code that does conversion.

2. Edit the Dockerfile

Modify the Dockerfile in the converter directory to replace ImageMagick with MyTool. Specifically change line numbers 11, 15, 16 and 17. You need to also change other fields like maintainer and may need to add instructions to install any specific software required by your converter. For example, you can see instruction to install ImageMagick software in the example Dockerfile:

...

Build the Dockerfile and start the converter:

Code Block
themeConfluence
docker-compose stop
docker build –t mytool .
docker-compose up

...