Commits

Anonymous committed 4208d7c

Added crop choice tuples and tweaked a couple of comments

Comments (0)

Files changed (1)

imagekit/models.py

 # Modify image file buffer size.
 ImageFile.MAXBLOCK = getattr(settings, 'PIL_IMAGEFILE_MAXBLOCK', 256 * 2 ** 10)
 
+# Choice tuples for specifying the crop origin.
+# These are provided for convienience.
+CROP_HORZ_CHOICES = (
+    (0, _('left')),
+    (1, _('center')),
+    (2, _('right')),
+)
+
+CROP_VERT_CHOICES = (
+    (0, _('top')),
+    (1, _('center')),
+    (2, _('bottom')),
+)
+
 
 class ImageModelBase(ModelBase):
+    """ ImageModel metaclass
+    
+    This metaclass parses IKOptions and loads the specified specification
+    module.
+    
+    """
     def __init__(cls, name, bases, attrs):
         parents = [b for b in bases if isinstance(b, ImageModelBase)]
         if not parents:
 class ImageModel(models.Model):
     """ Abstract base class implementing all core ImageKit functionality
     
-    Subclasses of ImageModel can override the inner IKOptions class to customize
+    Subclasses of ImageModel are augmented with accessors for each defined
+    image specification and can override the inner IKOptions class to customize
     storage locations and other options.
     
     """