From 4adfcdc8f31f3944755e6758acc5be2ceaa20ad2 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Thu, 29 Mar 2018 17:02:55 +0200 Subject: [PATCH] models: hide graphics-magick output (fixes #22906) --- fargo/fargo/models.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/fargo/fargo/models.py b/fargo/fargo/models.py index 6f0f17b..cec0e33 100644 --- a/fargo/fargo/models.py +++ b/fargo/fargo/models.py @@ -219,9 +219,12 @@ def create_thumbnail(sender, instance, created, **kwargs): dirpath = os.path.dirname(instance.thumbnail_full_path) if not os.path.isdir(dirpath): os.makedirs(dirpath) - subprocess.call(['gm', 'convert', '-geometry', 'x200', - instance.content.file.name, - instance.thumbnail_full_path]) + with open(os.devnull, 'w') as devnull: + subprocess.call(['gm', 'convert', '-geometry', 'x200', + instance.content.file.name, + instance.thumbnail_full_path], + stdout=devnull, + stderr=devnull) threading.Thread(target=do).start() -- 2.16.3