mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-27 09:44:31 +03:00
Resolved UNDONE by removing code
This commit is contained in:
parent
4e16a9a942
commit
76871795f7
|
@ -432,10 +432,6 @@ def _normalize_mode(im):
|
||||||
It may return the original image, or it may return an image converted to
|
It may return the original image, or it may return an image converted to
|
||||||
palette or 'L' mode.
|
palette or 'L' mode.
|
||||||
|
|
||||||
UNDONE: What is the point of mucking with the initial call palette, for
|
|
||||||
an image that shouldn't have a palette, or it would be a mode 'P' and
|
|
||||||
get returned in the RAWMODE clause.
|
|
||||||
|
|
||||||
:param im: Image object
|
:param im: Image object
|
||||||
:returns: Image object
|
:returns: Image object
|
||||||
"""
|
"""
|
||||||
|
@ -443,10 +439,7 @@ def _normalize_mode(im):
|
||||||
im.load()
|
im.load()
|
||||||
return im
|
return im
|
||||||
if Image.getmodebase(im.mode) == "RGB":
|
if Image.getmodebase(im.mode) == "RGB":
|
||||||
palette_size = 256
|
im = im.convert("P", palette=Image.Palette.ADAPTIVE)
|
||||||
if im.palette:
|
|
||||||
palette_size = len(im.palette.getdata()[1]) // 3
|
|
||||||
im = im.convert("P", palette=Image.Palette.ADAPTIVE, colors=palette_size)
|
|
||||||
if im.palette.mode == "RGBA":
|
if im.palette.mode == "RGBA":
|
||||||
for rgba in im.palette.colors.keys():
|
for rgba in im.palette.colors.keys():
|
||||||
if rgba[3] == 0:
|
if rgba[3] == 0:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user