Bug 505927 - Data loss in layer styles' gradients due to reliance on global presets
Summary: Data loss in layer styles' gradients due to reliance on global presets
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: layer styles (other bugs)
Version First Reported In: 5.2.9
Platform: Appimage Linux
: NOR major
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-06-21 15:51 UTC by Noel Santos
Modified: 2026-02-04 21:46 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Noel Santos 2025-06-21 15:51:35 UTC
SUMMARY
Using Gradient Overlay or a Stroke with gradient fill requires you to select or create a gradient preset which is stored globally. Despite the fact that Krita appears to keep a local copy of the values in the .kra file, if you ever modify the preset in the future, Krita will automatically reload the values from the gradient preset upon opening the file, without requiring any user interaction, silently changing the locally stored values to the global values.

This behavior leads to data loss in practice when a user modifies a preset unaware that they are modifying every use of that preset in every file they have ever created.

STEPS TO REPRODUCE
1. Create a new document
2. Add a gradient overlay layer style to the background layer
3. Create a new gradient preset for it
4. Save the document and close it
5. Create a second document
6. Add a gradient overlay layer style to the background layer
7. In the gradient preset selector, select the gradient preset you previously created and click Edit.
8. Modify the preset then save it.
9. Re-open the first document.

OBSERVED RESULT

The gradient that appears when you open the document is different from the gradient you had when you saved it.

EXPECTED RESULT

The document should look exactly the same way as you saved it.

ADDITIONAL INFORMATION

Fill layers and the gradient map filter can use gradient presets as well, but their GUI displays the local values and they don't reload from the preset automatically. I believe the layer styles GUI and behavior should be updated to match the other gradient UI's.

Personally, I feel very wary of using these layer styles since I know I'll probably modify one gradient preset by accident in the future and then file won't look like the way I saved it anymore.
Comment 1 Freya Lupen 2026-02-04 21:46:28 UTC
Fixed by 5.3.0-prealpha-97fbf20faf "Fix gradient handling in the layer style dialog" (https://invent.kde.org/graphics/krita/-/commit/97fbf20faf).