def create_thumbnail(f, width=200, height=100): im = Image.open(f) im.thumbnail((width, height), Image.ANTIALIAS) thumbnail_file = StringIO() im.save(thumbnail_file, 'JPEG') thumbnail_file.seek(0) return thumbnail_file
It seems that my error is "IOError: cannot identify image file"...based on my traceback log.