mirror of
https://github.com/Hopiu/django-imagekit.git
synced 2026-04-26 07:54:41 +00:00
Documentation
This commit is contained in:
parent
80a26a4f09
commit
cf821cfecd
2 changed files with 32 additions and 5 deletions
|
|
@ -76,6 +76,13 @@ class BasicCrop(object):
|
|||
|
||||
"""
|
||||
def __init__(self, x, y, width, height):
|
||||
"""
|
||||
:param x: The x position of the clipping box, in pixels.
|
||||
:param y: The y position of the clipping box, in pixels.
|
||||
:param width: The width position of the clipping box, in pixels.
|
||||
:param height: The height position of the clipping box, in pixels.
|
||||
|
||||
"""
|
||||
self.x = x
|
||||
self.y = y
|
||||
self.width = width
|
||||
|
|
@ -163,15 +170,20 @@ class Crop(object):
|
|||
|
||||
class SmartCrop(object):
|
||||
"""
|
||||
Crop an image 'smartly' -- based on smart crop implementation from easy-thumbnails:
|
||||
Crop an image to the specified dimensions, whittling away the parts of the
|
||||
image with the least entropy.
|
||||
|
||||
Based on smart crop implementation from easy-thumbnails:
|
||||
https://github.com/SmileyChris/easy-thumbnails/blob/master/easy_thumbnails/processors.py#L193
|
||||
|
||||
Smart cropping whittles away the parts of the image with the least entropy.
|
||||
|
||||
"""
|
||||
|
||||
def __init__(self, width=None, height=None):
|
||||
"""
|
||||
:param width: The target width, in pixels.
|
||||
:param height: The target height, in pixels.
|
||||
|
||||
"""
|
||||
self.width = width
|
||||
self.height = height
|
||||
|
||||
|
|
|
|||
|
|
@ -9,6 +9,11 @@ class BasicResize(object):
|
|||
|
||||
"""
|
||||
def __init__(self, width, height):
|
||||
"""
|
||||
:param width: The target width, in pixels.
|
||||
:param height: The target height, in pixels.
|
||||
|
||||
"""
|
||||
self.width = width
|
||||
self.height = height
|
||||
|
||||
|
|
@ -24,6 +29,11 @@ class Cover(object):
|
|||
|
||||
"""
|
||||
def __init__(self, width, height):
|
||||
"""
|
||||
:param width: The target width, in pixels.
|
||||
:param height: The target height, in pixels.
|
||||
|
||||
"""
|
||||
self.width, self.height = width, height
|
||||
|
||||
def process(self, img):
|
||||
|
|
@ -87,6 +97,11 @@ class SmartFill(object):
|
|||
|
||||
"""
|
||||
def __init__(self, width, height):
|
||||
"""
|
||||
:param width: The target width, in pixels.
|
||||
:param height: The target height, in pixels.
|
||||
|
||||
"""
|
||||
self.width, self.height = width, height
|
||||
|
||||
def process(self, img):
|
||||
|
|
@ -113,8 +128,8 @@ class Fit(object):
|
|||
:param upscale: A boolean value specifying whether the image should
|
||||
be enlarged if its dimensions are smaller than the target
|
||||
dimensions.
|
||||
:param mat_color: If set, the target image size will be enforced and
|
||||
the specified color will be used as background color to pad the image.
|
||||
:param mat_color: If set, the target image size will be enforced and the
|
||||
specified color will be used as a background color to pad the image.
|
||||
|
||||
"""
|
||||
self.width = width
|
||||
|
|
|
|||
Loading…
Reference in a new issue