siteposter
This commit is contained in:
parent
2633b3d738
commit
72c0a30d51
2 changed files with 2 additions and 1 deletions
|
@ -23,7 +23,7 @@ urlpatterns = patterns("item.views",
|
||||||
|
|
||||||
#poster
|
#poster
|
||||||
(r'^(?P<id>[A-Z0-9].+)/poster(?P<size>\d+)\.jpg$', 'poster'),
|
(r'^(?P<id>[A-Z0-9].+)/poster(?P<size>\d+)\.jpg$', 'poster'),
|
||||||
(r'^(?P<id>[A-Z0-9].+)/siteposter(?P<size>\d+)\.jpg$', 'siteposter'),
|
(r'^(?P<id>[A-Z0-9].+)/siteposter(?P<size>\d*)\.jpg$', 'siteposter'),
|
||||||
(r'^(?P<id>[A-Z0-9].+)/poster\.jpg$', 'siteposter'),
|
(r'^(?P<id>[A-Z0-9].+)/poster\.jpg$', 'siteposter'),
|
||||||
(r'^(?P<id>[A-Z0-9].+)/frameposter(?P<position>\d+).jpg$', 'poster_frame'),
|
(r'^(?P<id>[A-Z0-9].+)/frameposter(?P<position>\d+).jpg$', 'poster_frame'),
|
||||||
|
|
||||||
|
|
|
@ -604,6 +604,7 @@ def siteposter(request, id, size=None):
|
||||||
poster = item.path('siteposter.jpg')
|
poster = item.path('siteposter.jpg')
|
||||||
poster = os.path.abspath(os.path.join(settings.MEDIA_ROOT, poster))
|
poster = os.path.abspath(os.path.join(settings.MEDIA_ROOT, poster))
|
||||||
if size:
|
if size:
|
||||||
|
size = int(size)
|
||||||
image = Image.open(poster)
|
image = Image.open(poster)
|
||||||
image_size = max(image.size)
|
image_size = max(image.size)
|
||||||
if size < image_size:
|
if size < image_size:
|
||||||
|
|
Loading…
Reference in a new issue