Skip to content

Commit

Permalink
Do not edit text of mode strings
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Mar 7, 2021
1 parent 8206f14 commit e437a8f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/PIL/Image.py
Expand Up @@ -1913,7 +1913,7 @@ def resize(self, size, resample=BICUBIC, box=None, reducing_gap=None):
resample = NEAREST

if self.mode in ["LA", "RGBA"]:
im = self.convert(self.mode[:-1] + "a")
im = self.convert({"LA": "La", "RGBA": "RGBa"}[self.mode])
im = im.resize(size, resample, box)
return im.convert(self.mode)

Expand Down Expand Up @@ -1963,7 +1963,7 @@ def reduce(self, factor, box=None):
return self.copy()

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)
return im.convert(self.mode)

Expand Down Expand Up @@ -2398,7 +2398,7 @@ def getdata(self):

if self.mode in ("LA", "RGBA"):
return (
self.convert(self.mode.replace("A", "a"))
self.convert({"LA": "La", "RGBA": "RGBa"}[self.mode])
.transform(size, method, data, resample, fill, fillcolor)
.convert(self.mode)
)
Expand Down

0 comments on commit e437a8f

Please sign in to comment.