pushing compress_level=1 further to the caller of Image._dump() at ImageShow.save_image()

This commit is contained in:
Hin-Tak Leung 2017-05-10 21:37:29 +01:00
parent 26119d7e2e
commit 55a6bea81c
2 changed files with 4 additions and 4 deletions

View File

@ -577,7 +577,7 @@ class Image(object):
self.pyaccess = None self.pyaccess = None
self.readonly = 0 self.readonly = 0
def _dump(self, file=None, format=None): def _dump(self, file=None, format=None, **options):
import tempfile import tempfile
suffix = '' suffix = ''
if format: if format:
@ -588,11 +588,11 @@ class Image(object):
self.load() self.load()
if not format or format == "PPM": if not format or format == "PPM":
self.im.save_ppm(file) self.im.save_ppm(file, **options)
else: else:
if not file.endswith(format): if not file.endswith(format):
file = file + "." + format file = file + "." + format
self.save(file, format, compress_level=1) self.save(file, format, **options)
return file return file
def __eq__(self, other): def __eq__(self, other):

View File

@ -87,7 +87,7 @@ class Viewer(object):
def save_image(self, image): def save_image(self, image):
"""Save to temporary file, and return filename""" """Save to temporary file, and return filename"""
return image._dump(format=self.get_format(image)) return image._dump(format=self.get_format(image), compress_level=1)
def show_image(self, image, **options): def show_image(self, image, **options):
"""Display given image""" """Display given image"""