Resize split into Crop and Fit.

This commit is contained in:
Matthew Tretter 2011-09-08 09:15:31 -04:00
parent cd3395b68f
commit e32ccb617d

View file

@ -85,7 +85,7 @@ class Reflection(ImageProcessor):
return composite, fmt
class Resize(ImageProcessor):
class _Resize(ImageProcessor):
def __init__(self, width, height, crop=False, upscale=False):
self.width = width
@ -133,6 +133,16 @@ class Resize(ImageProcessor):
return img, fmt
class Crop(_Resize):
def __init__(self, width, height):
super(Crop, self).__init__(width, height, True)
class Fit(_Resize):
def __init__(self, width, height, upscale=False):
super(Fit, self).__init__(width, height, False, upscale)
class Transpose(ImageProcessor):
""" Rotates or flips the image