Skip to content

Commit

Permalink
Strip more gimp warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
mathiasburger committed Jun 18, 2019
1 parent 7d4ce54 commit 0587425
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions TODO.md
Expand Up @@ -4,3 +4,5 @@
* gimp exports gray image to png graya even though there is no need for that: save gray and rgb images without alpha when exporting to png
* pgimp.GimpFile.GimpFile#add_layer_from_file: add_layer_from_gimp_file, add_layer_from_file
* pgimp.gimp.layer.add_layer_from_file: currently only first layer is copied but when the image has multiple layers it would be more safe to merge visible layers
* do not rely on stdout and stderr anymore, use files to communicate
because gimp likes to pollute stdout and stderr unpredictably
3 changes: 2 additions & 1 deletion pgimp/GimpScriptRunner.py
Expand Up @@ -110,6 +110,7 @@ def is_xvfb_present():


def strip_gimp_warnings(input):
input = "\n".join([line for line in input.split('\n') if not line.startswith('EEEEeEeek!')])
if input.startswith('\n(gimp:'):
to_find = '\n\n(gimp:'
pos = 0
Expand All @@ -129,7 +130,7 @@ def strip_gimp_warnings(input):
def strip_initialization_warnings(error_lines):
strip_idx = 0
for i in range(len(error_lines)-1, 0-1, -1):
if error_lines[i].startswith('*WARNING*'):
if error_lines[i].startswith('*WARNING*') or error_lines[i].startswith('./gimp-bin: GEGL-WARNING:'):
strip_idx = i+1
break
error_lines = error_lines[strip_idx:]
Expand Down

0 comments on commit 0587425

Please sign in to comment.