From 76871795f787756ab1978772b53237948bec377a Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Sat, 12 Mar 2022 15:54:08 +1100 Subject: [PATCH] Resolved UNDONE by removing code --- src/PIL/GifImagePlugin.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/PIL/GifImagePlugin.py b/src/PIL/GifImagePlugin.py index 9cdd987da..25f7d9f40 100644 --- a/src/PIL/GifImagePlugin.py +++ b/src/PIL/GifImagePlugin.py @@ -432,10 +432,6 @@ 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 """ @@ -443,10 +439,7 @@ def _normalize_mode(im): 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: