mirror of
https://github.com/Hopiu/django-imagekit.git
synced 2026-04-21 13:34:43 +00:00
Changed ImageSpec constructor so you can use static properties.
For example:
class MyImageSpec(ImageSpec):
quality = 100
class Photo(ImageModel):
display = MyImageSpec()
This commit is contained in:
parent
0b0942921b
commit
db4d704f71
1 changed files with 9 additions and 5 deletions
|
|
@ -15,11 +15,15 @@ from django.core.files.base import ContentFile
|
|||
|
||||
class ImageSpec(object):
|
||||
|
||||
def __init__(self, processors, pre_cache=False, quality=70, increment_count=False):
|
||||
self.processors = list(processors or [])
|
||||
self.pre_cache = pre_cache
|
||||
self.quality = quality
|
||||
self.increment_count = increment_count
|
||||
processors = []
|
||||
pre_cache = False
|
||||
quality = 70
|
||||
increment_count = False
|
||||
|
||||
def __init__(self, processors=None, **kwargs):
|
||||
if processors:
|
||||
self.processors = processors
|
||||
self.__dict__.update(kwargs)
|
||||
|
||||
def process(self, image, obj):
|
||||
fmt = image.format
|
||||
|
|
|
|||
Loading…
Reference in a new issue