From 0173e9ee40eabbf04a2b68ff9ac9005dc7efa547 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 436212e..a789555 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 32a326e..1912fcf 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: