ImageKit Options
ImageKit is configured on a per-model basis using an inner class, similarly to Django's "Meta" class. This means that you can configure each model in your project or application separately. The following table lists the options available that can be overridden in your model's IKOptions class and their defaults.
Option Type Default Description admin_thumbnail_spec String 'admin_thumbnail' The accessor name of the image specification you want to use to display thumbnails in the Django admin. This is either the specification's class name in lowercase or it's 'access_as' property if set. cache_dir String 'cache' Relative path, from MEDIA_ROOT, where ImageKit will saved processed images. cache_filename_format String "%(filename)s_%(specname)s.%(extension)s" This option defines the format that ImageKit will use when saving processed files. It requires three placeholders;
filename : the original filename without the file extension,
extension: the extension of the original filename without preceding period and
specname: the name of the image specificationcrop_horz_field String 'crop_horz' The field name of an IntegerField or SmallIntegerField that specifies how this image should be cropped horizontally with 0 being from the left, 1 from the center and 2 from the right. crop_vert_field String 'crop_vert' The field name of an IntegerField or SmallIntegerField that specifies how this image should be cropped vertically with 0 being from the top, 1 from the center and 2 from the bottom. image_field String 'image' String name of the ImageField on the model you want processed. preprocessor_spec ImageSpec None If defined, your original image will be processed with this specification before being saved. Useful for implementing maximum image dimensions for example. NOTE: There are some issues with the current implementation of this feature and it will likely change in the future. save_count_as String None If defined, this should be an IntegerField on your model that ImageKit will increment each time a image specification with increment_count=True is accessed. It is recommended that you use the editable=False keyword argument when defining this field. spec_module String 'imagekit.defaults' String path of the module where your image specifications are defined. Must be available on the current Python PATH. storage Django Storage Object Defaults to ImageField Storage Sets the storage class ImageKit will use for generated images only. Original image will always use the storage class passed to the image field.
This revision is from 2010-08-26 01:05
via bitbucket.org
No comments:
Post a Comment