Anki Forums

Error 400 for copying and pasting images

Hello! I’m having problems seeing certain images that I copy/paste into Anki. This started very recently and only happens for a handful of sites that I need the images from. Upon pasting an image into a new cloze deletion card, I immediately get a pop-up that reads “Unexpected Response Code: 400” along with an “Ok” button underneath. Once I click the Ok button, the error goes away and I’m able to see the image in the new card. However, once I actually create the card and add it to my deck, I’m unable to see the image ever again. When I go to the Browser, in place of each of the images I only see the little “image placeholder” (the little image of a piece of paper with the cloud and mountain). I’m not sure if it’s a problem with the file of the image or not, since when I drag and drop the images from the website to my desktop, they appear normally as .PNG files. A couple other things: I tried the “check database” and it works without any problems; I did check my media too, which says 2 missing files, 20 unused files, but they don’t seem to line up with the 55 or so images that are missing from my most recent cards.

I also want to add, there’s no problem when I Sync my deck. In a bunch of other threads I read, people seemed to be getting a similar error when they tried to sync their deck. I’m still able to sync completely normally without any errors! However, I just don’t have those images the next time I open Anki.

I’m currently on Anki 2.1.49. I tried disabling all my add-ons, but the problem still occurs after restarting Anki with “shift” held down. I’ve restarted my laptop (I’m using Mac OS Catalina), but it didn’t help. I tried googling my question too, but I couldn’t find anyone else with this same error.

I would really appreciate any help you have to offer on this! So far, I lost around 55 images (it’s ok, I can live without those!) but I really want to try to fix this so the images I add to future cards are okay! Again, thank you so much in advance and please let me know if there’s any other information I can provide :slight_smile:

The site may be blocking you. You may have more luck copying the image to the clipboard, instead of a link to it.

I tried that too, but no luck. It’s strange because I can copy and paste the images to other documents and programs perfectly fine…except for anki! That’s why i thought it might be a problem on the anki-side. Can sites actually block people from using images on a specific application?

For now, I just found a temporary work-around that includes saving the images to my computer and then copying from there to anki. Slightly cumbersome, but works nonetheless! Please let me know if you think of anything else I can try. Thank you so much!