========= Thumbnail ========= The `thumbnail` module provides thumbnail creation, given an image file. Width and/or height can be given for the thumbnail to be created. If one is not given, the thumbnail size is generated at the best fit to keep the scale. Let's import the method:: >>> from thumbnail import generate Let's check the sample image size:: >>> from thumbnail import image_size >>> image_size(image_filename) (241, 600) And try the thumbnail generation over it:: >>> th1 = generate(image_filename, scale=0.5) >>> th2 = generate(image_filename, width=32) >>> th3 = generate(image_filename, height=64) >>> th4 = generate(image_filename, width=12, height=15) Let's control the results:: >>> from StringIO import StringIO >>> image_size(StringIO(th1)) (120, 298) >>> image_size(StringIO(th2)) (32, 79) >>> image_size(StringIO(th3)) (25, 62) >>> image_size(StringIO(th4)) (12, 29)