XnView Multi Platform places thumbnail cache in config directory instead of cache directory

*** Please report new bugs here! ***

Moderators: helmut, XnTriq, xnview, Dreamer

Post Reply
Self-Perfection
Posts: 1
Joined: Thu Feb 09, 2023 10:07 am

XnView Multi Platform places thumbnail cache in config directory instead of cache directory

Post by Self-Perfection »

I found that XnView Multi Platform stores thumbnail cache in ~/.config/xnviewmp/Thumb.db file. This is semantically incorrect. This file is essentially a cache and therefore should be placed in cache directory. See XDG Base Directory Specification for how is should be handled.

Basically the app should read cache directory location from XDG_CACHE_HOME env variable and if it is not set use "$HOME/.cache" as default.

Downsides of not following XDG_CACHE_HOME standard.
In my case:
  • Thumb.db is included in backups inflating their size and increasing backup time. ~/.cache directory is excluded from backups
  • I use snapper for hourly snapshots of my $HOME. ~/.cache is deliberately excluded from snapshots and ~/.config is snapshotted. Due to incorrect location of thumbnail cache and storing each hourly version of it it takes 3x times more space on filesystem than its current size.
Considerations on config dir
Looks like XDG_CONFIG_HOME is not handled as well. But it should be used according XDG Base Directory Specification. It allows a user run the app with different sets of config options in different circumstances.
dchristensen
Posts: 10
Joined: Sun Aug 11, 2024 5:37 pm

Re: XnView Multi Platform places thumbnail cache in config directory instead of cache directory

Post by dchristensen »

I agree that XDG_CACHE_HOME should be followed, or at least some kind of cache directory should be used.

For others reading this, you can manually set the folder that contains the Thumb.db file in Settings > Integration > Paths. Since Thumb.db can get large and can be recreated, I think it's best to store it in a cache directory that isn't backed up by default. I'm using ~/.cache/xnviewmp/
Post Reply