mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-02-04 21:50:54 +03:00
Merge pull request #2248 from uploadcare/use-_new
Use Image._new() instead of _makeself()
This commit is contained in:
commit
fb54b1da2e
|
@ -530,8 +530,6 @@ class Image(object):
|
||||||
new.info = self.info.copy()
|
new.info = self.info.copy()
|
||||||
return new
|
return new
|
||||||
|
|
||||||
_makeself = _new # compatibility
|
|
||||||
|
|
||||||
# Context Manager Support
|
# Context Manager Support
|
||||||
def __enter__(self):
|
def __enter__(self):
|
||||||
return self
|
return self
|
||||||
|
@ -997,7 +995,7 @@ class Image(object):
|
||||||
"only RGB or L mode images can be quantized to a palette"
|
"only RGB or L mode images can be quantized to a palette"
|
||||||
)
|
)
|
||||||
im = self.im.convert("P", 1, palette.im)
|
im = self.im.convert("P", 1, palette.im)
|
||||||
return self._makeself(im)
|
return self._new(im)
|
||||||
|
|
||||||
return self._new(self.im.quantize(colors, method, kmeans))
|
return self._new(self.im.quantize(colors, method, kmeans))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user