Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

imageio v2.33.0 requieres Pillow>=9.1.0 for GIFs #1052

Open
sitic opened this issue Nov 21, 2023 · 1 comment
Open

imageio v2.33.0 requieres Pillow>=9.1.0 for GIFs #1052

sitic opened this issue Nov 21, 2023 · 1 comment

Comments

@sitic
Copy link

sitic commented Nov 21, 2023

When using Pillow<9.1.0 (pip install pillow==9.0.1 imageio) importing a GIF fails:

import imageio.v3 as iio3
iio3.imread('https://upload.wikimedia.org/wikipedia/commons/8/8f/Example.gif')

error:

Traceback (most recent call last):
  File "imageio/v3.py", line 54, in imread
    return np.asarray(img_file.read(**call_kwargs))
  File "imageio/plugins/pillow.py", line 238, in read
    GifImagePlugin.LoadingStrategy.RGB_AFTER_DIFFERENT_PALETTE_ONLY
AttributeError: module 'PIL.GifImagePlugin' has no attribute 'LoadingStrategy'

PIL.GifImagePlugin.LoadingStrategy was added to Pillow in v9.1.0. This works with imageio<2.33.

@Pandede
Copy link
Contributor

Pandede commented Nov 22, 2023

Importing LoadingStrategy is due to this issue #1030 and I fixed it according to this PR python-pillow/Pillow#6150.

I may make a PR to lock the mode to RGB when loading the GIF if Pillow<9.1.0 (same as set LoadingStrategy to RGB_ALWAYS).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants