]> git.parisson.com Git - teleforma.git/commitdiff
try thumb
authorGuillaume Pellerin <yomguy@parisson.com>
Mon, 16 Sep 2013 12:32:05 +0000 (14:32 +0200)
committerGuillaume Pellerin <yomguy@parisson.com>
Mon, 16 Sep 2013 12:32:05 +0000 (14:32 +0200)
teleforma/models/core.py

index 361e4942c94bd84fbf789b2086cd1628b3162222..bf9f245df778367685fccc68f92841eb398f6223 100644 (file)
@@ -56,6 +56,7 @@ import jqchat.models
 from django.core.paginator import InvalidPage, EmptyPage
 from django.template.defaultfilters import slugify
 from sorl.thumbnail.images import ImageFile
+from sorl.thumbnail import default
 
 app_label = 'teleforma'
 
@@ -609,8 +610,9 @@ class Media(MediaBase):
         url = ''
         for related in self.item.related.all():
             if 'preview' in related.title:
-                im = ImageFile(related.file)
-                url = im.url
+                #im = ImageFile(related.file)
+                #url = im.url
+                url = default.backend.get_thumbnail(related.file, 640)
         return url
 
     class Meta(MetaCore):