Commit d04c64ec authored by fred's avatar fred

thumbnail: do not try resizing missing files

parent 09a4602a
......@@ -28,7 +28,7 @@ def thumbnail(image, size='100x100'):
os.path.getmtime(filename) > os.path.getmtime(miniature_filename):
os.unlink(miniature_filename)
# if the image wasn't already resized, resize it
if not os.path.exists(miniature_filename):
if not os.path.exists(miniature_filename) and os.path.exists(filename):
image = Image.open(filename)
if abs( (1.0*x/y) - (1.0*image.size[0]/image.size[1]) ) > 0.1:
# aspect ratio change, crop the image first
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment