Skip to content

Update QOI pixel index for run chunks - #10454

Closed
lianxiaozhi wants to merge 1 commit into
python-pillow:mainfrom
lianxiaozhi:fix/qoi-run-pixel-index
Closed

lianxiaozhi wants to merge 1 commit into
python-pillow:mainfrom
lianxiaozhi:fix/qoi-run-pixel-index

Conversation

@lianxiaozhi

Copy link
Copy Markdown

Fixes #10452.

QOI_OP_RUN skips the shared pixel-index update. An initial run of opaque black followed by a later INDEX reference can therefore decode as transparent black. This applies the fix suggested by @manit2004 in the report.

Changes proposed in this pull request:

  • Update the previously seen pixel index in the RUN branch, before discarding alpha for RGB output.
  • Add six regression cases covering RGB/RGBA and run lengths 1, 2 and 62. The three RGBA cases fail before the fix; the existing first-chunk INDEX regression remains passing.
  • Add a 13.1.0 release note.

Validation on macOS arm64 with Python 3.11.15, using a full editable source build of Pillow 13.1.0.dev0 and its native extensions:

  • Self-test: 59 passed. QOI tests: 14 passed.
  • Test suite: 5,587 passed, 372 skipped, 3 expected failures. The screen-capture test was explicitly deselected because no display is available; it also fails on unchanged upstream code. The skips are for platform-specific tests, optional dependencies and extra image fixtures.
  • tox -e lint and tox -e mypy: passed.
  • All eight official QOI test images match their PNG references exactly, including edgecase.qoi, which failed before the fix.

@lianxiaozhi

Copy link
Copy Markdown
Author

Closing in favor of #10453, which was opened first and contains the same decoder fix. Thanks @manit2004 for the report and fix.

The additional regression coverage and release note are available separately in lianxiaozhi@0078905, based on the author's PR head. This commit changes only the tests and release note, so it can be reused without duplicating the decoder change. The local validation results are recorded in this PR's description and in the follow-up on #10452.

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.

QOI: QOI_OP_RUN does not update the previously seen pixels, corrupting qoi_test_images/edgecase.qoi

2 participants