Media in collection.media shows up as a html link

hey,

Recently i have tried to sync my anki decks from my laptop to my computer using ankiweb.

All my decks appear, but none of the images show up and all i can see is the broken image icon.

When doing a media check every single image file shows up as either missing or unused, but when i check collection.media folder they’re are all there just saved as .html instead of jpg/png.

I have tried to install the decks separately instead of just sycimg through anki deck but this didn’t work either. I have over 5000+ files containing images ( i have been using anki since around october for med school, its a collection of decks i made plus some downloaded ones from my friends) so there is no way i could find all the images i need and reintroduce them into my deck that way. I am using anki for windows, and my computer still operates on windows 10, however i don’t know if that should pose any issues

You say you have all the files but only their extension changed? Maybe all you need to do is rename the files extensions and it works again.

On linux, running e.g.

file anatomy.html

on a file that has the .html extension but really is a .png file will return something like this:

anatomy.html: PNG image data, 552 x 908, 8-bit/color RGBA, non-interlaced

So in linux, you could run file to get the actual file type, then grep for PNG (and other file types you might have) and then just mv the file to .png if file determined it to be a PNG. That way you can automate the process.

I understand you are on windows and windows won’t have those commands. But maybe you could look on the internet for e.g. “file command for windows” to find the equivalent commands and automate the renaming process that way.

  1. Do the files in the collection.media folder on the laptop have their normal jpg/png extensions?
  2. What does ToolsCheck Media on the laptop Anki say?
  3. Can you try manually moving the files from the laptop collection.media folder to the computer one?

It’s hard to tell form your description whether this is a syncing issue, or there was a problem when you originally attached the files and they were named incorrectly, or you never attached the actual files and have just been linking to them where they are hosted on other sites.

Do you get the same results from Check Media on both devices?

If you don’t, it’s possible the files simply haven’t synced over yet – Media files may take time to sync - Anki FAQs . It might take several tries for the files to sync from your original install to AnkiWeb and from AnkiWeb to your new device.

Can you tell whether the html file is a locally saved html file, or a shortcut to a website?

In that same vein, it might help to see the raw HTML view of a field that references one of these files (click < > above the field to open that). That will tell us what your collection is actually trying to do.

I haven’t been able to do a media check on the laptop unfortunately, i’ve had to give it to repairs due to a battery issue. However I have checked the FAQ and after syncing multiple times and getting the collection sync completed message the issue persists

The images are all saved as shortcuts unfortunately

As for the raw html view i am unfamiliar with this and im not exactly sure what you mean by this, if you could maybe dumb it down even more for me i might be able to check what you want me to

1 I’m not sure, im not very familiar with computers unfortunately, however the saved files just redirect to microsoft edge

2 laptop is out of commission for the moment

3 ^

It’s accessible by clicking the <> button in the top right corner of the field with an image:

Also, while you are at it, can you confirm that the sync images is toggled on in your settings?

I’m still unsure where to find this, i can’t see it when i open the images

and yes, ive turned on sync audio and images

ok my bad, i’ve got it

It’s in the browser, which is opened by clicking “browse” at the top central menu and selecting any note in the list that should contain an image.


Also, what does the Media log button below this say when clicked?

(the regular “collection sync” message is for syncing just the note data, as far as I’m aware, not the media files)

Does that mean that there is a file with the exact same name but different extension in your collection.media folder? Namely, “12n.html”?

(post deleted by author)

there actually is not, which is weird. I’ve noticed that almost all of the files in the collection.media folder link to images that are image masks ( i use image occlusion add on) i did sync the decks before adding the add-on

media log button says

That makes sense. The masks are saved in .svg format opened by default in a web browser on windows, which is probably why it looks like html. They are also very lightweight, which is why the probably synced first.

It doesn’t, however, explain why the rest of the images are missing. If the media sync is complete, they should be available, unless they were missing in your cloud storage to begin with. Can you elaborate on how often/when you synced with the AnkiWeb from your laptop prior to that?

I synced the decks from my laptop to anki web just this morning right before logging in to ankiweb on my computer, so i had never synced anything before that.

Did you confirm that the image sync toggle was on and the media sync was completed?

Can you check any of the cards with the missing images directly on AnkiWeb instead of the desktop app?

I didn’t check if the media sync was completed before i synced to my computer, so maybe that’s the issue. The same issue shows up on my ankiweb so when i get my laptop back ill try resyncing and see if the issue resolves.

However, when downloading new decks shared as an apkg file the images still don’ show up, and i dont see how a syncing issue would cause that

Can you share any specific example of a deck that shows the problem?

Nevermind! I must have messed up the first time i downloaded a new deck. I reinstalled it and it seems to be working fine. I;ll try resyncing my old decks later and hopefully that’ll solve my issue

Thank you for your help so far