Bug 444504

Summary: Can't save a brush preset with brush tip from ABR file in Krita 5.0 without a safe assert
Product: [Applications] krita Reporter: Tiar <tamtamy.tymona>
Component: Resource ManagementAssignee: Dmitry Kazakov <dimula73>
Status: ASSIGNED ---    
Severity: normal CC: dimula73, halla
Priority: NOR    
Version First Reported In: git master (please specify the git hash!)   
Target Milestone: ---   
Platform: Mint (Ubuntu based)   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Tiar 2021-10-27 19:17:01 UTC
SUMMARY
If you try to save a new brush preset with a brush tip coming from an ABR file, there is a safe assert: SAFE ASSERT (krita): "resource->isSerializable() && "embedding non-serializable resources is not yet implemented"" in file /home/tymon/kritadev/krita/libs/image/brushengine/kis_paintop_preset.cpp, line 270

The resource saves, and it's even usable, until you remove the ABR file with brush tips.
The same goes if you try to put it into a bundle: first safe assert, then you can see it gets imported, but only works if you have the ABR file as well.

STEPS TO REPRODUCE
1. Download a, ABR file
2. Make a new brush preset with a brush tip from that file
3. Try to save it as a new brush preset

OBSERVED RESULT
SAFE ASSERT:
SAFE ASSERT (krita): "resource->isSerializable() && "embedding non-serializable resources is not yet implemented"" in file /home/tymon/kritadev/krita/libs/image/brushengine/kis_paintop_preset.cpp, line 270

EXPECTED RESULT
No safe assert, everything is saved correctly.

SOFTWARE/OS VERSIONS
Krita

 Version: 5.1.0-prealpha (git b58801a7ae)
 Languages: en_US, en, en_US, en, en_US, en, pl_PL, pl, pl_PL, pl
 Hidpi: true

Qt

  Version (compiled): 5.11.1
  Version (loaded): 5.11.1
Comment 1 Tiar 2021-10-27 19:18:31 UTC
Assigning to Dmitry because he and Halla are working on embedding resources. I'm not sure how the preset can even work with ABR file, since when this code is triggered, I don't think anything gets saved, so I would assume the filename of the brush tip as well, but maybe there is some failsafe solution.
Comment 2 Dmitry Kazakov 2021-12-06 09:42:13 UTC
The assert in question has been converted into a warning in Tiar's commit 97f401d356b62980db6c64c542c3a8c73806ddf3

We planned to refactor this part after Krita 5.0 is released, so I will unmark 'release_blocker' tag now, the issue doesn't block the user from normal work now. And embedding didn't exist in Krita 4.x at all.