Fix Image Resizer context menu appearing for unsupported file types#45427
Draft
Fix Image Resizer context menu appearing for unsupported file types#45427
Conversation
…ike PSD - Add extension whitelist check in both MSI and MSIX context menu handlers - Validate file extensions against supported list before showing menu - Prevents context menu from appearing for .psd and other unsupported formats Co-authored-by: yeelam-gordon <73506701+yeelam-gordon@users.noreply.github.com>
- Move extension list and validation function to ImageResizerConstants.h - Eliminate code duplication between MSI and MSIX handlers - Single source of truth for supported extensions Co-authored-by: yeelam-gordon <73506701+yeelam-gordon@users.noreply.github.com>
- Use modern convention (extension == nullptr) for better readability - Add clarifying comment about lowercase requirement in extension list Co-authored-by: yeelam-gordon <73506701+yeelam-gordon@users.noreply.github.com>
Security analysis completed - whitelist approach with proper input validation Co-authored-by: yeelam-gordon <73506701+yeelam-gordon@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix resize context menu for PSD files
Fix Image Resizer context menu appearing for unsupported file types
Feb 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of the Pull Request
Image Resizer context menu appeared for PSD and other unsupported formats, failing with error on resize attempt. Fixed by adding extension whitelist validation before showing menu.
PR Checklist
Detailed Description of the Pull Request / Additional comments
Root cause: Context menu handlers relied on
AssocGetPerceivedType()which returnsPERCEIVED_TYPE_IMAGEfor any Windows-registered image type (e.g., PSD via Photoshop). Image Resizer only processes WIC-compatible formats.Changes:
SupportedImageExtensionswhitelist and validation function toImageResizerConstants.hContextMenuHandler.cpp) and MSIX (dllmain.cpp) handlers to validate extensions inQueryContextMenu()andGetState()Implementation:
Single source of truth eliminates duplication between MSI/MSIX implementations.
Validation Steps Performed
Manual testing required:
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.