Skip to content

Certain animated GIFs cause TypeError: color must be int, or tuple of one, three or four elements #7514

@jonathan-villanueva

Description

@jonathan-villanueva
img = Image.open(image_data) frames = [frame.copy() for frame in ImageSequence.all_frames(img)]

Results in

frames = [frame.copy() for frame in ImageSequence.all_frames(img)] File "/usr/local/lib/python3.10/site-packages/PIL/ImageSequence.py", line 73, in all_frames ims += [im_frame.copy() for im_frame in Iterator(imSequence)] File "/usr/local/lib/python3.10/site-packages/PIL/ImageSequence.py", line 73, in <listcomp> ims += [im_frame.copy() for im_frame in Iterator(imSequence)] File "/usr/local/lib/python3.10/site-packages/PIL/ImageSequence.py", line 50, in __next__ self.im.seek(self.position) File "/usr/local/lib/python3.10/site-packages/PIL/GifImagePlugin.py", line 151, in seek self._seek(f) File "/usr/local/lib/python3.10/site-packages/PIL/GifImagePlugin.py", line 367, in _seek self.dispose = Image.core.fill(dispose_mode, dispose_size, color) TypeError: color must be int, or tuple of one, three or four elements

For some animated GIFs (attached)
f036dee3-ffb3-41c1-971d-535d1cdf08d3
b9183949-7173-41af-943d-dce1367f7047

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions