mirror of
https://github.com/Hopiu/django-imagekit.git
synced 2026-04-20 13:10:58 +00:00
Resize split into Crop and Fit.
This commit is contained in:
parent
cd3395b68f
commit
e32ccb617d
1 changed files with 11 additions and 1 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue