Bug 473699

Summary: PSD file export forgets layer name if only saving with one layer, reverting back to "Background"
Product: [Applications] krita Reporter: Stuben <Stubenhocker1399>
Component: File formatsAssignee: Krita Bugs <krita-bugs-null>
Status: CONFIRMED ---    
Severity: normal CC: dimula73, halla
Priority: NOR    
Version First Reported In: 5.1.5   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Stuben 2023-08-23 19:39:40 UTC
SUMMARY
PSD file export forgets layer name if only saving with one layer, reverting back to "Background"

STEPS TO REPRODUCE
1. Create new document, rename the single default layer, for example to "color"
2. Save as psd file
3. Close document
4. Reopen document

OBSERVED RESULT
Layer name reverts to the default name of "Background".

EXPECTED RESULT
Layer name keeps the new name, in this example "color".


SOFTWARE/OS VERSIONS
Linux: Arch Linux
(available in About System)
KDE Plasma Version: 5.27.7
KDE Frameworks Version: 5.109.0
Qt Version: 5.15.10

ADDITIONAL INFORMATION
This bug seems similar/related to https://bugs.kde.org/show_bug.cgi?id=417829 as saving a single group also resets the name back to "Background" (as well as merging all layers).
Comment 1 Bug Janitor Service 2023-09-02 02:06:33 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/krita/-/merge_requests/1929
Comment 2 Dmitry Kazakov 2023-10-21 08:42:50 UTC
Git commit fa04fc2c7eb8776850be70d61eedc3558441ca72 by Dmitry Kazakov, on behalf of Chris Multhaupt.
Committed on 21/10/2023 at 10:42.
Pushed by dkazakov into branch 'krita/5.2'.

Fix psd layer info for single layers or groups

Not writing the layer info when only having more than two children for
the root layer causes loss of data if the first child is a layer group.
Additionally, other layer properties such as name and opacity and more
do not get saved.
Related: bug 417829

M  +7    -24   plugins/impex/psd/psd_saver.cpp

https://invent.kde.org/graphics/krita/-/commit/fa04fc2c7eb8776850be70d61eedc3558441ca72
Comment 3 Dmitry Kazakov 2023-10-21 08:46:55 UTC
The commit has been reverted, so the bug is still open.