diff options
author | Parth Buch | 2012-07-17 14:21:30 +0530 |
---|---|---|
committer | Parth Buch | 2012-07-17 14:21:30 +0530 |
commit | 05ea9cf44d9666e134ce2ad0f7d81be7f18df15d (patch) | |
tree | 0e8d4e7a6feb6173bb3d0f8d8be9de9b7c4e9657 /stapp | |
parent | 9ba70b7280dd1fb937c0194de974a3957ec59b31 (diff) | |
download | stproject-05ea9cf44d9666e134ce2ad0f7d81be7f18df15d.tar.gz stproject-05ea9cf44d9666e134ce2ad0f7d81be7f18df15d.tar.bz2 stproject-05ea9cf44d9666e134ce2ad0f7d81be7f18df15d.zip |
Fixed the nasty thumbnail url bug
Diffstat (limited to 'stapp')
-rw-r--r-- | stapp/video/models.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/stapp/video/models.py b/stapp/video/models.py index 20af47c..1eb81f4 100644 --- a/stapp/video/models.py +++ b/stapp/video/models.py @@ -10,9 +10,8 @@ import Image, os def handle_thumb(image_obj, thumb_obj, width, height): # create thumbnail - if image_obj and not thumb_obj: - thumb = image_obj.path + ('-small.jpg') - #try: + thumb = str(image_obj) + ('-small.jpg') + try: t = Image.open(image_obj.path) w, h = t.size @@ -26,9 +25,9 @@ def handle_thumb(image_obj, thumb_obj, width, height): t.save(settings.MEDIA_ROOT + thumb, 'JPEG') os.chmod(settings.MEDIA_ROOT + thumb, 0666) - thumb_obj = image_obj.path + ('-small.jpg') - #except: - # pass + thumb_obj = thumb + except: + pass return thumb_obj |