Is there a way to make Immich treat file names as case INsensitive?
Immich is running for me on a Linux host which means file.MOV and file.mov are different files, and so it lets them be like this without adding a
+1
to either.
However, I am trying to work with these files (copy/backup) on a Windows system and this is causing a lot of problems for me.
Is there a way to force Immich to add the +1
to filenames that overlap if they were case-insensitive?
If not, is there a way that I could manually ask Immich to rename a particular file and clean these up by hand? (There are only a few of them. It happens in rare circumstances due to things like people sharing photos with me.)
EDIT: I do have Storage Template enabled, so files are in folders by date. The situation is that sometimes two files have the same name, differing only by case (always the extension) both within the same month and even day due to overlapping file names between phones who shared pictures with me and that being apparently how Apple deals with this, whether on purpose or by accident.
Sorry if this is not where I should ask this. It isn't broken, I am just looking for "how to" do something that may or may not be possible. I didn't see another channel for "general inquiries".17 Replies
:wave: Hey @ThinkOnTheEdge,
Thanks for reaching out to us. Please carefully read this message and follow the recommended actions. This will help us be more effective in our support effort and leave more time for building Immich :immich:.
References
- Container Logs:
docker compose logs
docs
- Container Status: docker ps -a
docs
- Reverse Proxy: https://immich.app/docs/administration/reverse-proxy
- Code Formatting https://support.discord.com/hc/en-us/articles/210298617-Markdown-Text-101-Chat-Formatting-Bold-Italic-Underline#h_01GY0DAKGXDEHE263BCAYEGFJA
Checklist
I have...
1. :ballot_box_with_check: verified I'm on the latest release(note that mobile app releases may take some time).
2. :ballot_box_with_check: read applicable release notes.
3. :ballot_box_with_check: reviewed the FAQs for known issues.
4. :ballot_box_with_check: reviewed Github for known issues.
5. :ballot_box_with_check: tried accessing Immich via local ip (without a custom reverse proxy).
6. :ballot_box_with_check: uploaded the relevant information (see below).
7. :ballot_box_with_check: tried an incognito window, disabled extensions, cleared mobile app cache, logged out and back in, different browsers, etc. as applicable
(an item can be marked as "complete" by reacting with the appropriate number)
Information
In order to be able to effectively help you, we need you to provide clear information to show what the problem is. The exact details needed vary per case, but here is a list of things to consider:
- Your docker-compose.yml and .env files.
- Logs from all the containers and their status (see above).
- All the troubleshooting steps you've tried so far.
- Any recent changes you've made to Immich or your system.
- Details about your system (both software/OS and hardware).
- Details about your storage (filesystems, type of disks, output of commands like fdisk -l
and df -h
).
- The version of the Immich server, mobile app, and other relevant pieces.
- Any other information that you think might be relevant.
Please paste files and logs with proper code formatting, and especially avoid blurry screenshots.
Without the right information we can't work out what the problem is. Help us help you ;)
If this ticket can be closed you can use the /close
command, and re-open it later if needed.Immich does not have anything resembling this feature, at least not through a GUI. You do have API access and if you're comfortable with bash or python scripting this could be accomplished that way. Though if I may suggest, it feels a little like you're posting an XY problem: https://xyproblem.info/
Can you describe exactly what it is you're trying to do in Windows? It may be possible to use WSL or some other method to accomplish your task a little easier.
For sure, just like I have thousands of images and there are about 30ish with this problem, so I feel like if I could just "hack" them away, I'd be happy and it wouldn't come back for years.
I'm literally just downloading entire folders of images from Immich to look at/edit/play with on my Windows system, and a couple of folders end up with missing images due to this.
I think the "real problem" is that Apple stores images that have overlapping filenames with differnet case in the extension. I'm honestly shocked that this is just "how it works" by default on iOS and MacOS, but my guess is that their system just does some sort of generic filename collision check and says, "It's fine" and moves on, and for some random reason, some files get into the system with upper-case extensions and others with lower-case extensions.
This also happens if you edit a video on an iPhone. The original video will be
IMG_####.mov
and the edited one will be IMG_####.MOV
But in that case I just delete the edited video everywhere and move on, as I don't need it.
iPhone also can just have duplicate file names for photos, I don't know how it manages that, but Immich adds +1
to those.
I just wish it could do that even if they overlap with different case.This is a very strange way for Apple to do things for sure. If your windows machine is already set up for WSL, I'm positive you could just use
rsync
to copy files from your Linux server to a WSL folder in your computer.Yeah, I could put them into a WSL filesystem, but that is another added complication and also the WSL filesystem is going to be slower to work with than the native NTFS filesystem.
The difference in performance has really narrowed with WSL2. I would just take the hit on performance because my time is more valuable than the computer's time π
Anyway, it's my 2 cents. Maybe someone else might have a solution that does not involve scripting.
To be fair, writing a script would only take me a few minutes if it is truly soemthing doable via API...
and yes, I can just live with it if must be, I wanted to try asking though rather than giving up before asking.
You can find the API documentation here. I don't think there is a way to pull files that have the same name if you ignore case sensitivity, but once you figure out how to do it, you could rename that asset by replacing it - that way, you retain the machine learning info.
https://immich.app/docs/api/replace-asset
Interesting, thanks. That's the best lead so far anyway. We'll see if I get around to it or give up. π
If anyone else arrives, regarding the "xyproblem", the problem is that I don't think that
IMG_1234.HEIC
and IMG_1234.heic
should represent entirely different photographs, despite the Linux filesystem allowing them to both exist in the same folder.
I would like to be able to "fix" that in Immich, despite not having control over what Apple decides to do.
Windows exposes the "problem", but I still wish I could fix it, even ignroing Windows.
(And one sure fix would be to just turn off Storage Template, which is tempting, but there are tradeoffs... I do enjoy having a nice folder structure based on date.)You should add the assetId to your storage template
Ohmygod that's such a simpler solution lol.

OH! Yes, this is the kind of idea I was looking for...
I use the timestamp and assetID in my file name template. I like that it identifies pictures as coming FROM immich (as opposed to needing upload), and in disaster case I can link it back to database entries
Wondering if - or _ is the best separator... or something else... (over-thinking phase before trying it out...)
I think I do Date_Time_filename__assetID
I avoid colons in the timestamp because those arenβt easy to work with
Successfully submitted, a tag has been added to inform contributors. :white_check_mark: