Skip to content

Stop using Image.getdata, which Pillow 14 removes - #568

Merged
godofecht merged 1 commit into
mainfrom
fix-gif-test-pillow
Aug 19, 2026
Merged

godofecht merged 1 commit into
mainfrom
fix-gif-test-pillow

Conversation

@godofecht

@godofecht godofecht commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

tests/unit/test_gif_flow_encoder.py::test_animation_actually_moves fails on main wherever Pillow escalates the Image.getdata deprecation to an error:

DeprecationWarning: Image.Image.getdata is deprecated and will be removed in
Pillow 14 (2027-10-15). Use get_flattened_data instead.

Comparing raw RGB bytes is the same comparison and works on every Pillow version, so this avoids pinning the replacement API that older Pillow does not have.

scripts/record_demos.py builds its crop mask the same way and would break on the same removal. Verified the rewrite produces a byte-identical mask and the same bbox on a synthetic image before changing it.

pytest tests/unit/test_gif_flow_encoder.py goes from 1 failed / 3 passed to 4 passed.

test_animation_actually_moves has been red on main since the local Pillow
started escalating the deprecation to an error. Comparing raw RGB bytes is
the same comparison and works on every Pillow version.

scripts/record_demos.py builds its crop mask the same way, so it would break
on the same removal; verified the rewrite produces an identical mask.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@godofecht
godofecht merged commit 41c96b5 into main Aug 19, 2026
19 checks passed
@godofecht
godofecht deleted the fix-gif-test-pillow branch August 19, 2026 08:50
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

Successfully merging this pull request may close these issues.

1 participant