Commit ba8f7d93 authored by fred's avatar fred

thumbnail to a pixel in case of unset image

parent 2f501534
......@@ -17,7 +17,7 @@ def thumbnail(image, size='100x100'):
# defining the filename and the miniature filename
try:
filehead, filetail = os.path.split(image.path)
except ValueError:
except (AttributeError, ValueError):
# return transparent pixel if the image doesn't actually exist
return 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAApJREFUCNdjYAAAAAIAAeIhvDMAAAAASUVORK5CYII='
basename, format = os.path.splitext(filetail)
......
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