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
Pillow v9.0.0 breaks test suite #719
Comments
I did some digging. The change in pillow that introduced this problem is mentioned in their changelog here: I opened python-pillow/Pillow#5929 to ask if this can be made more consistent and the way we should interact with this here depends a bit on the result of the discussion there. The gist of the issue is that the first frame of a GIF now has (pil-)mode We could simply skip pillow v9 for now, but my preferred approach would be to fix it correctly/properly because there are likely other worthwhile changes in pillow v9 that we can benefit from, and this seems like a small problem in comparison. |
I did some more digging, and this issue doesn't seem to resolve easily on our end. For GIF, we default to returning RGBA with the v2 pillow plugin, even if the GIF uses an RGB palette. This is problematic with pillow9, because each frame beyond the first will be returned as an RGB image (for RGB pallet GIFs) and our reader doesn't keep track of previously read frames. To us, each frame beyond the first looks like any other RGB image (which we don't promote to RGBA; I tried changing that, but that breaks a lot of other tests and isn't backward compatible). A proper solution would be to make this consistent and to rewrite parts of the v2 pillow plugin. However, the v3 pillow plugin already does that, so this would be redundant effort that will become obsolete quite quickly. @almarklein What is your preferred way forward here? We could: (1) mark the test as xfail and see if this causes trouble for any user, (2) limit ourselves to pillow<9.0.0 until we fully depreciate the v2 pillow plugin. Edit: Nvm the above. I found a way to solve this that only involves minimal changes on our end :) |
Pillow v9 introduced a change that broke our GIF reading test in the legacy pillow plugin:
imageio/tests/test_pillow_legacy.py
Lines 264 to 333 in 51f552b
It fails with:
The new (v3) pillow plugin is unaffected.
At the time of this writing, I don't know what causes this problem; however, if I find the time this week, I will check how to resolve this.
Edit: Looking at the AssertionError, it appears that this is because pillow now returns a RGB image instead of returning a RGBA image.
The text was updated successfully, but these errors were encountered: