Repository navigation
Pick only clipboard image types the decoder can read on Linux [patch] - #655
Merged
matt-edmondson merged 1 commit intoOct 18, 2026
Merged
Conversation
LinuxImageClipboard.PickType took PNG if offered, otherwise the first of image/jpeg, image/bmp and image/webp in the clipboard's own order. ImageDecoder cannot read WebP, so a clipboard listing image/webp before a BMP failed to paste even though a readable image was on offer, and a JPEG listed first won over a lossless BMP of the same image. PickType now walks a fixed preference list of decodable types (PNG, BMP, x-BMP, JPEG) and never chooses WebP. With nothing readable on offer it returns null, so the user sees the no-image message rather than a decode failure. Fixes #651 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01T3apQEs8uq9BSQJ2j8Z8mr
|
matt-edmondson
deleted the
claude/imguiapp-651-clipboard-decodable-types
branch
October 18, 2026 10:51
This was referenced Oct 19, 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.



Fixes #651
What was wrong
LinuxImageClipboard.PickTypetookimage/pngif the clipboard offered it. Otherwise it took whichever ofimage/jpeg,image/bmpandimage/webpcame first in the clipboard's own order. That caused two problems:ImageDecodercannot read WebP. A clipboard listingimage/webpbeforeimage/bmpfailed to paste, even though a readable BMP was on offer.Change
PickTypenow walks a fixed list of decodable types:image/png,image/bmp,image/x-bmp,image/jpeg. It returns the first one on offer, spelled as the clipboard lists it. WebP is never chosen.Tests
The three cases from the issue are added to
ImageClipboardTests:There are also cases for
image/x-bmpand for PNG still winning when it is listed last.With the fix reverted, both new test methods fail. With it, the full
ImGui.App.Testsrun passes (608 total, 0 failed).Generated by Claude Code