pumpkin-py / pumpkin-fun

Fun modules as extensions of pumpkin.py bot framework
GNU General Public License v3.0
0 stars 21 forks source link

Animations broken with Pillow>=11 #116

Open sinus-x opened 3 weeks ago

sinus-x commented 3 weeks ago

Pillow 11 has been released on 2024-10-15, and it broke gif generation for commands such as bonk or pet.

Directly affected are container-based deployments (they automatically install latest dependencies at container startup) and newly deployed baremetal deployments.

A workaround is to constraint Pillow<11 in requirements.txt. Proper fix would be through bumping the dependency and fixing the affected code.

Traceback ```py Traceback (most recent call last): File "/root/.local/lib/python3.11/site-packages/discord/ext/commands/core.py", line 235, in wrapped ret = await coro(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/pumpkin-py/modules/fun/fun/module.py", line 355, in bonk frames[0].save( File "/root/.local/lib/python3.11/site-packages/PIL/Image.py", line 2605, in save save_handler(self, fp, filename) File "/root/.local/lib/python3.11/site-packages/PIL/GifImagePlugin.py", line 774, in _save_all _save(im, fp, filename, save_all=True) File "/root/.local/lib/python3.11/site-packages/PIL/GifImagePlugin.py", line 787, in _save if not save_all or not _write_multiple_frames(im, fp, palette): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/.local/lib/python3.11/site-packages/PIL/GifImagePlugin.py", line 700, in _write_multiple_frames background_im.putpalette(im_frames[0].im.palette) File "/root/.local/lib/python3.11/site-packages/PIL/Image.py", line 2103, in putpalette self.load() # install new palette ^^^^^^^^^^^ File "/root/.local/lib/python3.11/site-packages/PIL/Image.py", line 909, in load self.im.putpalette(self.palette.mode, mode, arr) ValueError: invalid palette size ```
sinus-x commented 1 week ago

Blocked on https://github.com/python-pillow/Pillow/issues/8493.