darktable-org / darktable-org/darktable
ICC paths should be stored as relative, not absolute
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 13.1k
- Forks
- 1.4k
- Avg merge
- 22h 14m
- Merged PRs (30d)
- 198
Description
Is your feature request related to a problem? Please describe.
When I sync edited photos between my two computers with different filesystem layouts, the input color profiles are not found anymore, even if they have the same path (relative to the darktable user config folder) on both systems.
After the problem is fixed, toasts about the missing ICC continue to appear until the image history is compressed.
Describe the solution you'd like
I suggest changing the colorin.c module params (and for consistency, the output color profile module as well) to store relative filename instead of absolute.
At risk of going into implementation details I don't understand very well yet, legacy_params() would convert the absolute path to a relative path by taking the last path component, since ICCs in subdirectories are already not loaded. If work_filename is dynamically generated and not stored, that should stay as an absolute path. I doubt any work is needed to disambiguate between the same ICC in the user config and application directory, because the user directory currently wins and it should stay that way.
Alternatives
"Fix ICC paths" could be implemented as a Lua script, but I'm not sure the Lua runtime has enough access. Can Lua scripts modify module changes in history? This doesn't seem like a typical action.
Additional context
Raws from my camera are dramatically easier to white balance and edit when an appropriate camera profile has been applied.
The current workaround is complex: I need to find an example photo with the missing ICC, back up the .xmp, clear history, save the .xmp as version A, set the ICC again, clear history, save the .xmp as version B, and close darktable. To apply the changes, restore the .xmp backup, note the diff between A and B, apply the diff to all synced .xmp files, and open the collection in darktable. When prompted about inconsistency between the database and .xmp files, use the .xmp files.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the colorin.c module and its legacy_params() handling, then compare the output color profile module for the same path behavior. Trace how ICC paths are stored in history and .xmp files relative to the darktable user config folder, while preserving dynamically generated work_filename paths as absolute. Done means synced edits find the same ICC profiles and missing-ICC toasts no longer persist after history compression.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- desktop
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100