one code style for all methods

This commit is contained in:
homm 2016-06-02 10:06:49 +03:00
parent 3fa3b48ae9
commit f680b5417b

View File

@ -995,8 +995,7 @@ class Image(object):
im = self.im.convert("P", 1, palette.im) im = self.im.convert("P", 1, palette.im)
return self._makeself(im) return self._makeself(im)
im = self.im.quantize(colors, method, kmeans) return self._new(self.im.quantize(colors, method, kmeans))
return self._new(im)
def copy(self): def copy(self):
""" """
@ -1007,8 +1006,7 @@ class Image(object):
:returns: An :py:class:`~PIL.Image.Image` object. :returns: An :py:class:`~PIL.Image.Image` object.
""" """
self.load() self.load()
im = self.im.copy() return self._new(self.im.copy())
return self._new(im)
__copy__ = copy __copy__ = copy
@ -1935,8 +1933,7 @@ class Image(object):
:param distance: Distance to spread pixels. :param distance: Distance to spread pixels.
""" """
self.load() self.load()
im = self.im.effect_spread(distance) return self._new(self.im.effect_spread(distance))
return self._new(im)
def toqimage(self): def toqimage(self):
"""Returns a QImage copy of this image""" """Returns a QImage copy of this image"""