# Bug report - incorrect media referencing on 2nd paste

**URL:** <https://forums.ankiweb.net/t/bug-report-incorrect-media-referencing-on-2nd-paste/71382>\
**Category:** Help\
**Created:** [October 9, 2026, 11:06pm UTC](https://forums.ankiweb.net/t/bug-report-incorrect-media-referencing-on-2nd-paste/71382 "2026-10-09T23:06:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![flerbuburr](https://avatars.discourse-cdn.com/v4/letter/f/7bcc69/32.png) [@flerbuburr](https://forums.ankiweb.net/u/flerbuburr)\
**Post date:** [October 9, 2026, 11:06pm UTC](https://forums.ankiweb.net/t/bug-report-incorrect-media-referencing-on-2nd-paste/71382/1 "2026-10-09T23:06:44Z")

</div>

Hi, I just wanted to report a bug that I may have identified, and it sounds like others have been experiencing a similar issue.

**Device info** : Macbook M1

**Anki** : Version ⁨26.09.2

**Date of onset** : a 1-2 weeks ago?

**Issue** : incorrect media referencing in the CSS when you copy and paste the **same image** from **outside** of anki, a **subsequent time** into the same or a different card on the desktop app.

This seems to be **specifically a case-sensitive change** , where the name of the initial image from outside the media folder is capitalised (e.g. TEST.png), but pasting it into anki for the first time converts it into all lower case (and this is what is replicated in the code and in the media folder e.g. test.png).

However, a subsequent paste from the original file outside of the media folder or anki will retain the original case in the code (e.g. TEST.png) - and this causes the media to appear as referenced by cards, but “not found in the media folder” and as a “?” on an iphone/ipad, but not on desktop.

---

<div class="post-metadata">

**Author:** ![BenJamesBen](https://avatars.discourse-cdn.com/v4/letter/b/13edae/32.png) [@BenJamesBen](https://forums.ankiweb.net/u/BenJamesBen)\
**Post date:** [October 10, 2026, 2:46am UTC](https://forums.ankiweb.net/t/bug-report-incorrect-media-referencing-on-2nd-paste/71382/2 "2026-10-10T02:46:22Z")

</div>

I was able to reproduce this behavior on Anki 26.09.3, macOS Golden Gate 27.0.1.

I think what might be happening during the second paste is that [`add_data_to_folder_uniquely()`](https://github.com/ankitects/anki/blob/d64812b680426c6dd55f9de7004070e560361d4b/rslib/src/media/files.rs#L167) is checking the hash for a file named “TEST.png” to see if the file already exists in media.collection. However, on case insensitive filesystems, doing so results in a false positive if “test.png” was previously added (from the first paste). Because of the false positive, Anki believes that “TEST.png” exists in media.collection and adds “TEST.png” to the note field.
