mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-27 17:54:32 +03:00
commit
cab9179a85
|
@ -1975,7 +1975,7 @@ class Image:
|
||||||
resample = NEAREST
|
resample = NEAREST
|
||||||
|
|
||||||
if self.mode in ["LA", "RGBA"] and resample != NEAREST:
|
if self.mode in ["LA", "RGBA"] and resample != NEAREST:
|
||||||
im = self.convert(self.mode[:-1] + "a")
|
im = self.convert({"LA": "La", "RGBA": "RGBa"}[self.mode])
|
||||||
im = im.resize(size, resample, box)
|
im = im.resize(size, resample, box)
|
||||||
return im.convert(self.mode)
|
return im.convert(self.mode)
|
||||||
|
|
||||||
|
@ -2025,7 +2025,7 @@ class Image:
|
||||||
return self.copy()
|
return self.copy()
|
||||||
|
|
||||||
if self.mode in ["LA", "RGBA"]:
|
if self.mode in ["LA", "RGBA"]:
|
||||||
im = self.convert(self.mode[:-1] + "a")
|
im = self.convert({"LA": "La", "RGBA": "RGBa"}[self.mode])
|
||||||
im = im.reduce(factor, box)
|
im = im.reduce(factor, box)
|
||||||
return im.convert(self.mode)
|
return im.convert(self.mode)
|
||||||
|
|
||||||
|
@ -2463,18 +2463,11 @@ class Image:
|
||||||
:returns: An :py:class:`~PIL.Image.Image` object.
|
:returns: An :py:class:`~PIL.Image.Image` object.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if self.mode == "LA" and resample != NEAREST:
|
if self.mode in ("LA", "RGBA") and resample != NEAREST:
|
||||||
return (
|
return (
|
||||||
self.convert("La")
|
self.convert({"LA": "La", "RGBA": "RGBa"}[self.mode])
|
||||||
.transform(size, method, data, resample, fill, fillcolor)
|
.transform(size, method, data, resample, fill, fillcolor)
|
||||||
.convert("LA")
|
.convert(self.mode)
|
||||||
)
|
|
||||||
|
|
||||||
if self.mode == "RGBA" and resample != NEAREST:
|
|
||||||
return (
|
|
||||||
self.convert("RGBa")
|
|
||||||
.transform(size, method, data, resample, fill, fillcolor)
|
|
||||||
.convert("RGBA")
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if isinstance(method, ImageTransformHandler):
|
if isinstance(method, ImageTransformHandler):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user