From 33b34110a1c82025387897db5209cfc0ae528336 Mon Sep 17 00:00:00 2001 From: Francesco Siddi Date: Thu, 8 Oct 2015 14:17:22 +0200 Subject: [PATCH] Fix for thumbnail extension generation --- pillarsdk/files.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pillarsdk/files.py b/pillarsdk/files.py index dbac48a..0d4c3c0 100755 --- a/pillarsdk/files.py +++ b/pillarsdk/files.py @@ -1,3 +1,4 @@ +from os.path import splitext from .resource import List from .resource import Find from .resource import Create @@ -56,8 +57,8 @@ class File(List, Find, Create, Post, Update, Delete, Replace): a thumbnail, without querying the database. """ if size in ['s', 'b', 't', 'm', 'l', 'h']: - name = self.link.split('.')[0] - return "{0}-{1}.jpg".format(name, size) + root, ext = splitext(self.link) + return "{0}-{1}.jpg".format(root, size) else: raise ValueError("Size should be (s, b, t, m, l, h)")