Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Work around issue #559 in training material.
- Loading branch information
1 parent
c4231a9
commit cccbcf4
Showing
2 changed files
with
26 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,24 @@ | ||
import os | ||
from os.path import basename | ||
|
||
from gc3libs import Application | ||
from gc3libs.quantity import GB | ||
|
||
|
||
class GrayscaleApp(Application): | ||
"""Convert an image file to grayscale.""" | ||
def __init__(self, img): | ||
inp = basename(img) | ||
out = "gray-" + inp | ||
Application.__init__( | ||
self, | ||
arguments=[ | ||
"convert", inp, "-colorspace", "gray", out], | ||
inputs=[img], | ||
outputs=[out], | ||
output_dir="grayscale.d", | ||
stdout="stdout.txt", | ||
stderr="stderr.txt") | ||
"""Convert an image file to grayscale.""" | ||
def __init__(self, img): | ||
inp = basename(img) | ||
out = "gray-" + inp | ||
Application.__init__( | ||
self, | ||
arguments=[ | ||
"convert", inp, "-colorspace", "gray", out], | ||
inputs=[img], | ||
outputs=[out], | ||
output_dir="grayscale.d", | ||
stdout="stdout.txt", | ||
stderr="stderr.txt", | ||
# this is needed to circumvent GC3Pie issue #559, see | ||
# <https://github.com/uzh/gc3pie/issues/559> | ||
requested_memory=1*GB) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters