File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -286,13 +286,17 @@ def generate_pdiff_image(before_path, after_path):
286286 # 0 on success & similar images
287287 # 1 on success & dissimilar images
288288 # 2 on failure
289- result = subprocess .call ([
290- 'compare' ,
291- '-metric' , 'RMSE' ,
292- '-highlight-color' , 'Red' ,
293- '-compose' , 'Src' ,
294- before_path , after_path , diff_path
295- ])
289+ PIPE = subprocess .PIPE
290+ p = subprocess .Popen ([
291+ 'compare' ,
292+ '-metric' , 'RMSE' ,
293+ '-highlight-color' , 'Red' ,
294+ '-compose' , 'Src' ,
295+ before_path , after_path , diff_path
296+ ], stdin = PIPE , stdout = PIPE , stderr = PIPE )
297+ output , err = p .communicate () # `compare` is noisy; this swallows its output
298+ result = p .returncode
299+
296300 if result == 2 :
297301 raise ImageMagickError ('compare failed. Perhaps image dimensions differ.' )
298302 if result == 0 :
You can’t perform that action at this time.
0 commit comments