From 6c25558c82fddef5b32716e7226963e37f7a42bc Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Wed, 10 Aug 2011 16:00:03 +0200 Subject: [PATCH] icon without frame --- pandora/item/models.py | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/pandora/item/models.py b/pandora/item/models.py index 3defed756..fe87ef303 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -961,22 +961,21 @@ class Item(models.Model): def make_icon(self): frame = self.get_poster_frame_path() + icon = self.path('icon.jpg') + self.icon.name = icon + timeline = self.path('timeline.64.png') + timeline = os.path.abspath(os.path.join(settings.MEDIA_ROOT, timeline)) + cmd = [settings.ITEM_ICON, + '-i', self.icon.path + ] + if os.path.exists(timeline): + cmd += ['-l', timeline] if frame: - icon = self.path('icon.jpg') - self.icon.name = icon - timeline = self.path('timeline.64.png') - timeline = os.path.abspath(os.path.join(settings.MEDIA_ROOT, timeline)) - if os.path.exists(timeline): - cmd = [settings.ITEM_ICON, - '-f', frame, - '-l', timeline, - '-i', self.icon.path - ] - p = subprocess.Popen(cmd) - p.wait() - self.save() - return icon - return None + cmd += ['-f', frame] + p = subprocess.Popen(cmd) + p.wait() + self.save() + return icon def delete_item(sender, **kwargs): i = kwargs['instance']