Add image clipboard support (ported from ankushvangari's fork)#3
Open
MiMoHo wants to merge 4 commits into
Open
Add image clipboard support (ported from ankushvangari's fork)#3MiMoHo wants to merge 4 commits into
MiMoHo wants to merge 4 commits into
Conversation
Flycut now captures, stores, displays, and pastes back images from the clipboard alongside text clippings. Images are stored as TIFF files on disk at ~/Library/Application Support/Flycut/Images/ using SHA-256 content hashing for deduplication. When both text and image are present on the clipboard, both are captured as separate entries. - FlycutImageStore: new singleton for file-based image storage - FlycutClipping: extended with imageHash, imageSize, isImageClipping - BezelWindow: added NSImageView for image thumbnail display - pollPB: detects NSPasteboardTypeTIFF/PNG alongside text - Paste-back works for images in bezel, menu, and search window - Save-to-file (S key) exports images as .tiff - Search matches image clippings by source app name - Preferences: "Capture images" toggle, 10MB max size default - Image files cleaned up when clippings are evicted from history Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Chromium browsers flatten animated GIFs to a still PNG on "Copy Image" but embed the source GIF URL in the clipboard HTML. Detect that URL and download the original animated GIF instead of capturing the still. - Format-aware image store: files keyed by content hash + real extension (.gif/.png/.tiff); a resolver finds whatever extension a hash was stored under, so existing .tiff clippings keep working. - Carry the pasteboard UTI (e.g. com.compuserve.gif) on image clippings through capture, persistence (reusing the saved "Type"), and paste-back. - pollPB prefers a real GIF on the pasteboard; otherwise it reads the <img src> URL from the clipboard HTML and downloads the GIF (https only, .gif path, size cap, 5s timeout, animated-only; skips on failure). - Paste GIF clippings back as a file-URL only, so apps like Slack/Discord upload the actual animated file instead of flattening raw image data to a single frame. - Bezel preview animates GIFs (imagePreview.animates = YES). - New "Download animated GIFs from web" preference (default on). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The GIF-preservation feature fetches the first <img src> URL found in copied HTML over the network, triggered automatically on copy. With it enabled by default, copying attacker-authored web content silently causes Flycut to issue an HTTPS request to an arbitrary host - a tracking/SSRF primitive, and a surprise for an app that otherwise makes zero network connections. Default the preference to NO so users must knowingly enable it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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
This ports image clipboard support from @ankushvangari's downstream fork (ankushvangari/Flycut) into this repo, so the feature lands here instead of fragmenting the fork landscape further.
~/Library/Application Support/Flycut/Images/Provenance & licensing
The two feature commits are cherry-picked with original authorship preserved from ankushvangari/Flycut, which is a direct descendant of this repo (its history branches off your current
masterat d944e30). Both repos carry the identical MITlicense.txt, so merging is license-clean. I added a credit line for Ankush Vangari toacknowledgements.txt.Security review & hardening
I had the ported code security-reviewed before opening this PR:
<img src>URL found in copied HTML — with it enabled by default, copying attacker-authored web content would silently trigger a network request to an arbitrary host (tracking/SSRF primitive) from an app that otherwise makes zero network connections. This PR defaultsdownloadAnimatedGIFsto NO so it is an explicit opt-in. A follow-up could additionally block loopback/private-range hosts when the option is on.Testing
The ported commits are the exact code ankushvangari's CI has built and shipped (their v3.x releases). Cherry-picks applied cleanly onto d944e30; all files pass
clang -fsyntax-onlyagainst the macOS SDK. I could not run a fullxcodebuildlocally (no full Xcode on this machine), so a CI build/smoke test on your side is appreciated.🤖 Generated with Claude Code