Bug when trying to paste images copied from Discord messages into cards

When copying images from Discord (using its right-click menu → copy image) and trying to paste them into Anki cards, Anki will insert an image from collection.media called “image.png” instead of the image in the clipboard (if no file with that name exists, a broken image icon appears). So no matter what I copy from Discord, Anki will only ever paste that one wrong image.

This is on Windows 10, using Anki Desktop 25.09.4 (but it has happened on older versions too).

I have been very diligent about excluding potential error sources:

  • i’ve checked whether the clipboard actually contains the correct image after copying in Discord; it does, I can paste it anywhere else without an issue
  • “Paste clipboard as PNG” makes no difference
  • Anki inserts the HTML code <img src="image.png"> into the card instead of creating a unique file name
  • This happens with all external Add-Ons disabled/removed

As far as I can tell, this is not an image collision problem, since Anki would just rename another “image.png” if I pasted it in there (I have tested this, too).

My guess is that Discord is providing some sort of text or html blob along with the image in its clipboard item, and Anki prioritizes that over the bitmap. Or perhaps it chooses the wrong paste code? I have heard about separate code paths for internal and external copy/paste.

In any event: Can I somehow force Anki to paste the correct image?

And if not: How can I ask the developers for help in fixing the issues?

Is this happening only with discord or other websites, too?

I am able to reproduce the described behavior, macOS Tahoe 26.6.2, Anki 26.09b1, Dsicord app 0.0.409.

Some experimenting:

  1. Copy image from the Discord app and then:
  2. Apple Finder, Edit > Show Clipboard: image correctly shown
  3. Paste into:
    • Anki app: (broken image icon, <img src="image.png"> in HTML editor)
    • Notes app: (broken image icon)
    • TextEdit app, RTF document: (broken image icon)
    • Pages app: image correctly pasted
    • Freeform app: image correctly pasted
    • Safari, Anki forum editor: image correctly uploads and appears

The behavior seems to occur only with images copied from the Discord app. It doesn’t occur with images copied from Safari.


I found a workaround for Mac desktop users. Pasting from the Clipboard History works successfully. (I’m guessing that this is because rather than pasting the original copied image, it instead pastes a copy of the image stored as a file in the directory where Clipboard History items are stored.) The workaround is available starting with macOS Tahoe 26, the version that added the Clipboard History feature.

Setting up the Workaround:

  1. Press Command-Space (⌘␣) to open Spotlight and then press Command-4 (⌘4) to switch to the Clipboard.
  2. The first time you do this, it asks you if you want to enable the Clipboard History feature. Enable it. (You only have to do this one time.)

The Workaround:

  1. Copy an image from Discord using the right-click context menu > Copy Image.
  2. In the Anki app, insert the cursor where you want the image pasted.
  3. Press Command-Space then Command-4 (⌘␣ ⌘4) to open Spotlight and switch to the Clipboard.
  4. Right-click on the image (it will be at the top of the list) to open the context menu and select Paste.

Edit: Added:

Another workaround, which should work for non-Mac users as well. Instead of copying the image directly from the Discord app…

  1. In the Discord app, right-click on an image to bring up the context menu, and then Open Image Link.
  2. The image should open in your web browser. (The image file is retrieved from the web server where Discord stores attached images.)
  3. In the web browser, right-click on the image to bring up the context menu, and then Copy Image.
  4. You can now paste the image into the Anki app.

I should have clarified, this is a problem with the Discord app, not the web version. Copy & paste from the web works as expected.

I found another workaround, which is to open the image in a lightbox by clicking it in Discord, and then dragging it into Anki. This will not work if you clicked the image again to zoom in on it, only at its original display size.

Discord seems to have changed some of its behavior and options a bit since we discussed this last year –

– but it still seems like something that Discord is causing. There are definitely other apps (besides Anki) where I can’t paste images copied from the Discord app without saving them first.

..and there are plenty where it works, so it sounds like something Anki should be able to do. Let’s not be too quick to make this someone else’s problem :slight_smile:

Anki doesn’t owe anyone anything. I pasted this into MS Word and it didn’t work either. Why?

And here’s why. This information is in the clipboard when received as “HTML Format.”
And this is what it should look like:

So the problem is on Discord’s side, not Anka’s.

Here’s an image I just copied from Discord and pasted into this forum:

Why does this work then? Is the forum software doing something better or worse than Anki?

Ask Microsoft the same question :slight_smile:

The clipboard stores data in several different formats and representations at the same time so that it can be read correctly by different programs.

But Anki prefers the HTML format, just like MS Word.

But Discord doesn’t save correctly to HTML format, and Anki can handle this error, of course, but why should it? Why don’t you post in Discord?

But do you think it’s better to NOT handle this gracefully on Anki’s side?

(I am also reporting this to Discord btw, i don’t know why you assumed I didn’t)

It’s impossible to anticipate every error. And if there’s an error in the HTML, how can you tell if there’s an error in the BITMAP? After all, whoever sends the data to the clipboard should be responsible for quality.

Thank you. Logged here:

I didn’t mean to suggest it was “someone else’s problem.” And I especially didn’t mean to set you up as needing to defend why you thought it should be fixed. I was only trying to adjust expectations about whether it would be fixed, or was even fixable.