Quality of thumbnails can be changed in templates

Signed-off-by: CapsLock <faimaison@legeox.net>
This commit is contained in:
CapsLock 2016-01-17 11:08:36 +01:00 committed by Laurent Peuch
parent 5f5e5ba033
commit 799b816413

View File

@ -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)