Permalink
Browse files

fixed bug in gallery creation

  • Loading branch information...
1 parent 07cbcb0 commit 9329bcf7a890ca26451d70d9fc2820357d6f2cdc @ralsina committed Apr 25, 2012
Showing with 9 additions and 8 deletions.
  1. +9 −8 nikola/nikola.py
View
@@ -624,15 +624,16 @@ def task_render_galleries():
except ImportError:
try:
from PIL import Image
- def create_thumb(src, dst):
- size = THUMBNAIL_SIZE, THUMBNAIL_SIZE
- im = Image.open(src)
- im.thumbnail(size, Image.ANTIALIAS)
- im.save(dst)
except ImportError:
- create_thumb = copy_file
-
-
+ Image = None
+ if Image:
+ def create_thumb(src, dst):
+ size = THUMBNAIL_SIZE, THUMBNAIL_SIZE
+ im = Image.open(src)
+ im.thumbnail(size, Image.ANTIALIAS)
+ im.save(dst)
+ else:
+ create_thumb = copy_file
# gallery_path is "gallery/name"
for gallery_path in gallery_list:

0 comments on commit 9329bcf

Please sign in to comment.