Changeset 165:6811f8d6cb25 for cachers/thumbnail.py
- Timestamp:
- 08/23/07 15:23:15 (12 months ago)
- Files:
-
- 1 modified
-
cachers/thumbnail.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
cachers/thumbnail.py
r139 r165 27 27 def _new_size(image, width, height, scale): 28 28 """calculate new size""" 29 if width == -1: 30 width = None 31 if height == -1: 32 height = None 29 33 img_width, img_height = image.size 30 34 if width is None and height is None and scale is None: 31 35 return image.size 36 37 if width is not None and height is not None: 38 return width, height 32 39 33 40 if width is not None or height is not None: … … 49 56 width, height = _new_size(image, width, height, scale) 50 57 51 image.thumbnail((width, height), Image.ANTIALIAS) 58 #image.thumbnail((width, height), Image.ANTIALIAS) 59 #image.resize((width, height), Image.ANTIALIAS) 60 image.load() 61 image = image._new(image.im.stretch((width, height), Image.NEAREST)) 52 62 53 63 data = StringIO()
