mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-15 20:06:28 +03:00
Simplified code
This commit is contained in:
parent
1d7cbeb338
commit
8206f14419
|
@ -2396,18 +2396,11 @@ class Image:
|
||||||
:returns: An :py:class:`~PIL.Image.Image` object.
|
:returns: An :py:class:`~PIL.Image.Image` object.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if self.mode == "LA":
|
if self.mode in ("LA", "RGBA"):
|
||||||
return (
|
return (
|
||||||
self.convert("La")
|
self.convert(self.mode.replace("A", "a"))
|
||||||
.transform(size, method, data, resample, fill, fillcolor)
|
.transform(size, method, data, resample, fill, fillcolor)
|
||||||
.convert("LA")
|
.convert(self.mode)
|
||||||
)
|
|
||||||
|
|
||||||
if self.mode == "RGBA":
|
|
||||||
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