Images copied from browsers or file-backed apps are pasteable but have no thumbnail
Describe the bug
On Windows, some copied images remain fully pasteable into applications such as Photoshop, email clients, and chat applications, but CopyQ does not show an image thumbnail.
I can reproduce two variants in CopyQ 16.0.0:
- Browser “Copy image”: CopyQ stores only
text/htmlcontaining a single<img src="https://…">plustext/plaincontaining the image URL. The item appears as a small generic icon or an empty item. - File-backed image copy (for example, an image copied from the Windows WeChat image viewer): CopyQ stores only
text/plainsuch asfile:///C:/.../image.jpg. The item displays the path instead of a thumbnail.
In both cases, activating the CopyQ item and pasting it into other applications successfully produces the image. A screenshot copied as actual image/png data displays correctly in CopyQ.
This appears related to #2046 and #932, but it is still reproducible with CopyQ 16.0.0 on Windows.
To Reproduce
Browser case:
- In a Chromium-based browser, right-click an embedded image and choose Copy image.
- Open CopyQ.
- Observe that the entry has no thumbnail and contains only HTML plus the source URL.
- Activate the item and paste it into an image-capable application; the image pastes successfully.
Local-file-reference case:
- Copy an image from an application that exposes it as a temporary file reference.
- Open CopyQ.
- Observe a
file:///...jpgentry without a thumbnail. - Activate and paste the item elsewhere; the image pastes successfully while the temporary file still exists.
Expected behavior
Please consider an optional built-in setting to resolve image references for preview and storage. Possible controls:
- Resolve local
file://image references. - Resolve a browser-copied single
<img>element by downloading itssrc. - Preserve the original clipboard formats and add the corresponding
image/*data. - Optionally cache the bytes so the item remains usable after a temporary file is removed.
- Provide a maximum size, network timeout, and a privacy warning/toggle for remote images.
Working workaround / implementation guidance
Two automatic CopyQ commands solved the problem locally:
- For
file://references: normalize/decode the Windows path, read it withFile, determine the MIME type from the suffix, and callsetData(imageMime, file.readAll()). - For browser HTML containing a single
<img>: extract and HTML-decodesrc, ensure that the plain-text URL matches it, fetch it withnetworkGet(), use the HTTPContent-Type, and callsetData(imageMime, reply.data).
This converts both reference-only representations into real image items while keeping the original HTML, URL, or file path available.
Version, OS and Environment
- CopyQ 16.0.0
- Windows
- Portable ZIP build
Additional context
The item image plugin is enabled and configured correctly. Items that already contain image/png render normally, so the problem is specifically the reference-only clipboard representations above.
Verified result
After installing those two automatic commands, both cases work as expected:
- Browser-copied images immediately display a thumbnail because the remote source is fetched once and the returned bytes are stored as
image/*. - File-backed images from applications such as WeChat immediately display a thumbnail because the referenced local file is read and its bytes are stored as
image/*.
The original HTML/URL/file-path formats remain intact, so pasting behavior is preserved. For the local-file case, storing the bytes also prevents the CopyQ entry from breaking after the source application's temporary file is deleted.
This confirms the missing functionality can be implemented inside CopyQ's existing command/script APIs and would be useful as a built-in opt-in feature in a future release.
Source: hluk/CopyQ