Wednesday, October 20, 2010

jdriscoll / django-imagekit / wiki / Options – Bitbucket - I heart ImageKit

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.

OptionTypeDefaultDescription
admin_thumbnail_specString'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_dirString'cache'Relative path, from MEDIA_ROOT, where ImageKit will saved processed images.
cache_filename_formatString"%(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 specification
crop_horz_fieldString'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_fieldString'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_fieldString'image'String name of the ImageField on the model you want processed.
preprocessor_specImageSpecNoneIf 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_asStringNoneIf 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_moduleString'imagekit.defaults'String path of the module where your image specifications are defined. Must be available on the current Python PATH.
storageDjango Storage ObjectDefaults to ImageField StorageSets 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

Posted via email from Color and Voice

No comments:

Post a Comment