Skip to content

Commit

Permalink
Resolved UNDONE by removing code
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Mar 12, 2022
1 parent 4e16a9a commit 7687179
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/PIL/GifImagePlugin.py
Expand Up @@ -432,21 +432,14 @@ def _normalize_mode(im):
It may return the original image, or it may return an image converted to
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
:returns: Image object
"""
if im.mode in RAWMODE:
im.load()
return im
if Image.getmodebase(im.mode) == "RGB":
palette_size = 256
if im.palette:
palette_size = len(im.palette.getdata()[1]) // 3
im = im.convert("P", palette=Image.Palette.ADAPTIVE, colors=palette_size)
im = im.convert("P", palette=Image.Palette.ADAPTIVE)
if im.palette.mode == "RGBA":
for rgba in im.palette.colors.keys():
if rgba[3] == 0:
Expand Down

0 comments on commit 7687179

Please sign in to comment.