From 09c2f2570bba6b00a7374209363d022476a31bb9 Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Wed, 9 Dec 2015 07:05:48 +0100 Subject: [PATCH] [enh] yay, handle thumbnails in pictures-group --- prosopopoee | 10 ++++++++++ templates/sections/pictures-group.html | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/prosopopoee b/prosopopoee index 71a6cc1..3551be7 100755 --- a/prosopopoee +++ b/prosopopoee @@ -22,6 +22,16 @@ class TemplateFunctions(): print os.path.join(self.base_dir, image), "->", os.path.join(self.target_dir, image) return "" + def generate_thumbnail(self, image, gm_geometry): + thumbnail_name = image.split(".") + thumbnail_name[-2] += "-small" + thumbnail_name = ".".join(thumbnail_name) + + command = "gm convert %s -resize %s %s" % (os.path.join(self.base_dir, image), gm_geometry, os.path.join(self.target_dir, thumbnail_name)) + print command + os.system(command) + return thumbnail_name + def error(test, error_message): if test: diff --git a/templates/sections/pictures-group.html b/templates/sections/pictures-group.html index 0ec33c9..d3ddb21 100644 --- a/templates/sections/pictures-group.html +++ b/templates/sections/pictures-group.html @@ -5,7 +5,7 @@ {{ helpers.copy_image(image) }}
- +
{% if not loop.last %}