From 72c0a30d51c8128e3e5df52bfb0494d257d23bdc Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Tue, 23 Aug 2011 22:51:57 +0200 Subject: [PATCH] siteposter --- pandora/item/urls.py | 2 +- pandora/item/views.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pandora/item/urls.py b/pandora/item/urls.py index 436212efc..a78955539 100644 --- a/pandora/item/urls.py +++ b/pandora/item/urls.py @@ -23,7 +23,7 @@ urlpatterns = patterns("item.views", #poster (r'^(?P[A-Z0-9].+)/poster(?P\d+)\.jpg$', 'poster'), - (r'^(?P[A-Z0-9].+)/siteposter(?P\d+)\.jpg$', 'siteposter'), + (r'^(?P[A-Z0-9].+)/siteposter(?P\d*)\.jpg$', 'siteposter'), (r'^(?P[A-Z0-9].+)/poster\.jpg$', 'siteposter'), (r'^(?P[A-Z0-9].+)/frameposter(?P\d+).jpg$', 'poster_frame'), diff --git a/pandora/item/views.py b/pandora/item/views.py index 32a326e3f..1912fcf9c 100644 --- a/pandora/item/views.py +++ b/pandora/item/views.py @@ -604,6 +604,7 @@ def siteposter(request, id, size=None): poster = item.path('siteposter.jpg') poster = os.path.abspath(os.path.join(settings.MEDIA_ROOT, poster)) if size: + size = int(size) image = Image.open(poster) image_size = max(image.size) if size < image_size: