Packaging questions

currently the build system installs the gmic_cluts.gmz into the gimp plugin directory … this seems wrong.

wouldnt something like /usr/share/gmic/ make more sense?

also how big would be the “uncompressed” files be? would it be possible to add something like /usr/share/gmic/cluts/ to the search path for those uncompressed files? or are they arch dependent? also how can I unpack those files in my RPM build?

last point for now: a lot of files you currently store in ~/.config/gmic/ should probably not be there (like the unpacked cluts/update files) there are better directories like ~/.local/share/gmic or .cache/gmic/

The uncompresses CLUTs would be between 1-2MB each. @David_Tschumperle’s new compression algorithm is extremely efficient, reducing them to 0.3% of their original size.

:+1: for ~/.cache/gmic

I doubt that …

137133  clut_fuji_xtrans_iii_acros.cimgz
149995  clut_fuji_xtrans_iii_astia.cimgz

by those numbers it would be roughly 83MB for all 550

having to do that only once during the build of the rpm and then shipped in /usr/share/gmic/cluts/ would be worth it imho

That actually depends on the resolution you want for your CLUTs. In G’MIC, I’m using 48^3, which is not really big. In RawTherapee, they use 144^3 instead, which then generate very big files at the end.

with your file size i would be happy. … which brings us back to the question /usr/share/gmic/cluts/ … and how to generate those .cimgz files

About the folder I use to store the resources: I had to find something simple enough to make it easy to find both for Windows and Linux users.
If there is some standard environment variable on Linux to access to a correct folder path, then I’ll be happy to do so. If it requires some C++ code to get it, it’s already too late.

well that is the nice thing about XDG … you can just append the XDG paths to the user home directory … and be done

https://specifications.freedesktop.org/basedir-spec/latest/ar01s03.html

OK, so you suggest I’m using $XDG_CACHE_HOME/gmic instead of $XDG_CONFIG_HOME/gmic to store the CLUTs, but what is the point of doing this ?
At least when stored in $XDG_CACHE_HOME/gmic, the user won’t have to decompress a CLUT again and again each time its computer is switched off. I’m not sure what I decompress the CLUTs in a temporary folder.

$XDG_CACHE_HOME is also not cleared on each reboot.

but it is easier for e.g. run backups because you can just ignore the cache dir. gmic mixes that.

OK that makes sense. Thanks for the suggestion, I’ll do the modification.

Thank you … now to the other questions from my first post?:smiley:

About the location of file gmic_cluts.gmz?
Do you suggest it also go to the same location than decompressed CLUTs ?

  1. why the file is installed into the plugin dir instead of e.g. /usr/share/gmic/? I guess the gmic binary or the krita plugin use the cluts gmz file as well. not just the gimp plugin.
  2. how can i provide those unpacked files during the package build.
  3. which system directory should I use for them.

I can try to read it from anywhere, what folder would you like ?
$XDG_CACHE_HOME/gmic/gmic_cluts.gmz is OK for you ?

that is a user specific directory again. and it might require some code changes to recognize … the cluts gmz file i just downloaded to the cache dir is newer and I need to use local cluts now.

Having a folder change is not a problem, as it will be recognized as soon as the user get its first filter update (which is done automatically at first run).