Skip to content

[peek, explorer] Update QOI reader for 3-channel images #39304

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

Merged
merged 1 commit into from
May 30, 2025

Conversation

mbartlett21
Copy link
Contributor

Summary of the Pull Request

Make sure we account for Bitmap row length being a multiple of 4 when reading Qoi files.

PR Checklist

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

Built and run and restarted file explorer.
Sample files from my comment on the issue (after rewriting each one to force the thumbnail to regenrate):
image

@mbartlett21 mbartlett21 changed the title Fix qoi preview [peek, explorer] Update QOI reader for 3-channel images May 8, 2025
@mbartlett21
Copy link
Contributor Author

Also, some feedback on developing, it would be good to have a note that I may need to enable long paths in order to build PowerToys. (It results in all sorts of various errors while building).

@lei9444 lei9444 self-assigned this May 16, 2025
@lei9444 lei9444 added this to the PowerToys 0.92 milestone May 16, 2025
@yeelam-gordon yeelam-gordon requested a review from Copilot May 16, 2025 08:13
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a bug in the QOI reader for 3-channel images by adjusting the reading algorithm to account for bitmap row length (which must be a multiple of 4). Key changes include introducing a pixel position counter and a row padding adjustment to align data correctly with the bitmap stride.

Comments suppressed due to low confidence (1)

src/common/FilePreviewCommon/QoiImage.cs:160

  • [nitpick] Consider renaming 'x' to a more descriptive name like 'pixelX' or 'currentColumn' to improve readability.
x++;

@yeelam-gordon yeelam-gordon requested a review from lei9444 May 16, 2025 08:14
@lei9444
Copy link
Contributor

lei9444 commented May 30, 2025

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@lei9444 lei9444 merged commit 89c33fa into microsoft:main May 30, 2025
10 checks passed
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.

2 participants