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.
|
||||
"""
|
||||
|
||||
if self.mode == "LA":
|
||||
if self.mode in ("LA", "RGBA"):
|
||||
return (
|
||||
self.convert("La")
|
||||
self.convert(self.mode.replace("A", "a"))
|
||||
.transform(size, method, data, resample, fill, fillcolor)
|
||||
.convert("LA")
|
||||
)
|
||||
|
||||
if self.mode == "RGBA":
|
||||
return (
|
||||
self.convert("RGBa")
|
||||
.transform(size, method, data, resample, fill, fillcolor)
|
||||
.convert("RGBA")
|
||||
.convert(self.mode)
|
||||
)
|
||||
|
||||
if isinstance(method, ImageTransformHandler):
|
||||
|
|
Loading…
Reference in New Issue
Block a user