Bug 517221 - Having patterns in their own folder and then using a pattern on a fill layer makes krita unable to save.
Summary: Having patterns in their own folder and then using a pattern on a fill layer ...
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Resource Management (other bugs)
Version First Reported In: 5.2.6
Platform: Other Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Dmitry Kazakov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-03-07 04:46 UTC by citrusmillie
Modified: 2026-03-09 14:24 UTC (History)
2 users (show)

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


Attachments
The dialogue box that opens when attempting to save. (19.03 KB, image/jpeg)
2026-03-07 04:46 UTC, citrusmillie
Details

Note You need to log in before you can comment on or make changes to this bug.
Description citrusmillie 2026-03-07 04:46:41 UTC
Created attachment 190440 [details]
The dialogue box that opens when attempting to save.

SUMMARY
If you use a Fill layer with a pattern then the pattern file is stored in the saved .kra file as an embedded resource. However, it seems that having the pattern files inside their own folder, within the -\krita\patterns folder makes them inaccessible to the file saving process. 

STEPS TO REPRODUCE
1. Install patterns in their own sub-folder in the  \krita\patterns folder
2. Create a fill layer and then adjust the properties of the layer and choose one of the new patterns
3. Attempt to save as a .kra file.

OBSERVED RESULT
A dialogue box pops up stating there was a problem with saving, and Krita "could not export resource for embedding." 

EXPECTED RESULT
The save function would work as intended and save as a .kra file.

SOFTWARE/OS VERSIONS
Windows: 11
macOS: 
(available in the Info Center app, or by running `kinfo` in a terminal window)
Linux/KDE Plasma: 
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION

Easily fixed by closing krita, moving the new pattern files into the main pattern folder, and deleting the now empty pattern sub-folder.
Comment 1 Ahab Greybeard 2026-03-07 20:33:15 UTC
This was first reported at https://krita-artists.org/t/cant-save-could-not-export-resource-for-embedding/172075

I can confirm this for the appimage versions 5.2.16 and the 6th March 6.1.0-prealpha (git ca7160e) but it's not that the .kra file can't be saved.

The .kra file is saved but there is no saving of the required resource, i.e. the pattern file, hence the error message.
The consequence is that the user can open the .kra file and see its correct appearance because krita can find the referred pattern in its own resources.
However, the .kra file can not be correctly presented if it is sent to another user who does not have the pattern file because the Fill layers would then be presented as empty with no error or warning message given.

I realise that manually putting patterns into a subfolder of the resources 'patterns' folder is the old-fashioned way of doing things but let's hope there is a clean and informative way of dealing with this situation.
Comment 2 Dmitry Kazakov 2026-03-09 14:23:54 UTC
Git commit fe3c46e1c06a06247985f43605e9bf78ad40c85a by Dmitry Kazakov.
Committed on 09/03/2026 at 14:20.
Pushed by dkazakov into branch 'master'.

Fix memory storage to handle resources with subfolders

M  +34   -24   libs/resources/KisMemoryStorage.cpp
M  +50   -0    libs/resources/tests/TestMemoryStorage.cpp
M  +3    -0    libs/resources/tests/TestMemoryStorage.h

https://invent.kde.org/graphics/krita/-/commit/fe3c46e1c06a06247985f43605e9bf78ad40c85a
Comment 3 Dmitry Kazakov 2026-03-09 14:24:16 UTC
Git commit 2954aad65beaaed9e78da8a91c8a047f0d32594b by Dmitry Kazakov.
Committed on 09/03/2026 at 14:24.
Pushed by dkazakov into branch 'krita/6.0'.

Fix memory storage to handle resources with subfolders

M  +34   -24   libs/resources/KisMemoryStorage.cpp
M  +50   -0    libs/resources/tests/TestMemoryStorage.cpp
M  +3    -0    libs/resources/tests/TestMemoryStorage.h

https://invent.kde.org/graphics/krita/-/commit/2954aad65beaaed9e78da8a91c8a047f0d32594b