Skip to content

Commit

Permalink
Resize split into Crop and Fit.
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewwithanm committed Sep 8, 2011
1 parent cd3395b commit e32ccb6
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion imagekit/processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def process(self, img, fmt, obj):
return composite, fmt


class Resize(ImageProcessor):
class _Resize(ImageProcessor):

def __init__(self, width, height, crop=False, upscale=False):
self.width = width
Expand Down Expand Up @@ -133,6 +133,16 @@ def process(self, img, fmt, obj):
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
Expand Down

0 comments on commit e32ccb6

Please sign in to comment.