From 799b816413405e00e24cb3a0d663391a7df39982 Mon Sep 17 00:00:00 2001 From: CapsLock Date: Sun, 17 Jan 2016 11:08:36 +0100 Subject: [PATCH] Quality of thumbnails can be changed in templates Signed-off-by: CapsLock --- prosopopee/prosopopee.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/prosopopee/prosopopee.py b/prosopopee/prosopopee.py index c6ae00d..4294a79 100644 --- a/prosopopee/prosopopee.py +++ b/prosopopee/prosopopee.py @@ -60,7 +60,7 @@ class TemplateFunctions(): print source, "->", target return "" - def generate_thumbnail(self, image, gm_geometry): + def generate_thumbnail(self, image, gm_geometry, gm_quality=75): thumbnail_name = image.split(".") thumbnail_name[-2] += "-small" thumbnail_name = ".".join(thumbnail_name) @@ -68,7 +68,7 @@ class TemplateFunctions(): source, target = os.path.join(self.base_dir, image), os.path.join(self.target_dir, thumbnail_name) if CACHE.thumbnail_needs_to_be_generated(source, target): - command = "gm convert %s -resize %s %s" % (source, gm_geometry, target) + command = "gm convert %s -resize %s -quality %s" % (source, gm_geometry, gm_quality, target) print command os.system(command)