mirror of
https://github.com/Hopiu/django-imagekit.git
synced 2026-04-12 17:21:01 +00:00
Gives precedence to user options
Previously, options set by `AutoConvert` had higher precedence than those explicitly passed by the user. This corrects that.
This commit is contained in:
parent
788365d6db
commit
62d39ccf9e
2 changed files with 3 additions and 2 deletions
|
|
@ -147,7 +147,8 @@ class _ImageSpecFileMixin(object):
|
|||
if getattr(self.field, 'autoconvert', True):
|
||||
autoconvert_processor = AutoConvert(format)
|
||||
img = autoconvert_processor.process(img)
|
||||
options.update(autoconvert_processor.save_kwargs)
|
||||
options = dict(autoconvert_processor.save_kwargs.items() + \
|
||||
options.items())
|
||||
|
||||
imgfile = img_to_fobj(img, format, **options)
|
||||
content = ContentFile(imgfile.read())
|
||||
|
|
|
|||
|
|
@ -251,6 +251,6 @@ class AutoConvert(object):
|
|||
img = bg.convert('RGB')
|
||||
|
||||
if self.format == 'JPEG':
|
||||
self.save_kwargs.setdefault('optimize', True)
|
||||
self.save_kwargs['optimize'] = True
|
||||
|
||||
return img
|
||||
|
|
|
|||
Loading…
Reference in a new issue