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:
Matthew Tretter 2011-11-16 10:27:18 -05:00
parent 788365d6db
commit 62d39ccf9e
2 changed files with 3 additions and 2 deletions

View file

@ -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())

View file

@ -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