Changeset 165:6811f8d6cb25 for cachers
- Timestamp:
- 08/23/07 15:23:15 (11 months ago)
- Location:
- cachers
- Files:
-
- 2 modified
-
cached_image.py (modified) (1 diff)
-
thumbnail.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
cachers/cached_image.py
r142 r165 5 5 from StringIO import StringIO 6 6 7 logging.basicConfig(level=logging.DEBUG,8 format='%(asctime)s %(levelname)s %(message)s',9 filename='cached.log',10 filemode='w')7 #logging.basicConfig(level=logging.DEBUG, 8 # format='%(asctime)s %(levelname)s %(message)s', 9 # filename='cached.log', 10 # filemode='w') 11 11 12 12 console = logging.StreamHandler() -
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()
