Default_compressed_extensions.txt on linux system is case sensitive

After long searching I found the reason for my performance problems. The default_compressed_extensions.txt does not work out of the box on Linux systems.

Seems the comparison is case sensitive, and all pics and videos with extensions xxx.MOV, yyy.JPG, zzz.MP4 are compressed - because only .mov .jpg .mp4 are mentionen in the default_compressed_extensions.txt

Is there any good way to make this case insensitive, without doubling all the entries in the default_compressed_extensions.txt file? (and if I double it, special cases like .Jpg are not covered as well)

Don’t get me wrong - the default extensions file is really great and I appreciate it. Would just be good to handle all cases on Linux systems.

Not seeing any case insensitivity for this in the docs or in the code.

It looks limited in the code to look at as they switch to other values and pass that around so it shouldn’t be able to be re-checked for sensitivity just anywhere in the code. Thus, I don’t think I missed anything.

The probable things looks to be to download and use source with your change, write the code into a setting and submit that, or use something like Libre Office or Microsoft Office / Word to far more quickly switch the cases and duplicate into the file with the case changes.

Also, maybe using the terminal to adjust all cases of the files but that would affect the backup so you would probably want to redo the backup fresh after this one.

Or use the filters in Duplicati but I didn’t check to see if this is also or not. Just throwing that in. It does have a text box as well which might be this for all I know.

From what I see that’s what you have to work with.

Good find and thanks for reporting. Are you able to open an issue on the Github page? This should be trivial to fix.

It looks like a past issue report might already answer their opinion on it actually Case insensitive filtering · Issue #2145 · duplicati/duplicati · GitHub

Also according to that

(?i) case insensitive

But I do not see if that’s possible with default_compressed_extensions.txt. When I looked at it, it wasn’t with that intent. If it doesn’t (and offhand without looking at it again I would say it doesn’t) then maybe that might be an issue to create.

But, also if it works with the filters inside Duplicati which I believe its for then could just go that way instead.

They might be a bit iffy or stubborn about it. I can see them based on the linked issue just closing it but there’s a chance (I suppose).

If it is, then it’s probably the right solution!

It might be as simple as providing a case-insensitive IEqualityComparer to the Dictionary of hints here:

Currently, we provide a case-sensitive comparer if the filesystem is determined to be case sensitive.

My bad if anyone got my earlier replies that I deleted lol. Looks like IEqualityComparer should also work but the following quick change also works here as a test.

var hints = new Dictionary<string, CompressionHint>(StringComparer.OrdinalIgnoreCase);

.MP4 is indeed then treated as “Noncompressible”. Without that, .MP4 is treated as “CompressionHint.Default;”

Also the test shows that a .txt file will return as CompressionHint.Default so it looks to be okay.

Interesting so Library.Utility.Utility.ClientFilenameStringComparer looks like there’s already code to handle this. Just need to change that so a setting can override it. What do you think?