mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-05-22 22:05:50 +00:00
Allow changing of JPEG compression quality
This commit is contained in:
parent
96ead1d4a9
commit
4492f326c5
1 changed files with 6 additions and 1 deletions
|
|
@ -307,7 +307,12 @@ class Filter(models.Model):
|
|||
for operation in self.operations:
|
||||
operation.run(willow, image)
|
||||
|
||||
willow.save(willow.original_format, output)
|
||||
if willow.original_format == 'jpeg':
|
||||
# Allow changing of JPEG compression quality
|
||||
quality = getattr(settings, 'WAGTAILIMAGES_JPEG_COMPRESSION_QUALITY', 85)
|
||||
willow.save_as_jpeg(output, quality=quality)
|
||||
else:
|
||||
willow.save(willow.original_format, output)
|
||||
|
||||
return output
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue