Bug 390584

Summary: Opening a .psd, then saving as .psd, then opening file again creates internal error
Product: [Applications] krita Reporter: Peter Mueller <muepet>
Component: File formatsAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: halla, info3dl, muepet
Priority: NOR Keywords: triaged
Version: 3.3.3   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed In:
Attachments: Example psd which crashes after save and open

Description Peter Mueller 2018-02-16 20:59:22 UTC
Good day,

with the attached file: Open in krita, then save (no changes). Then trying to open the file again leads to internal error.

I'm on Windows 10, 64bit. Let me know, if you need more info.

BR

Peter
Comment 1 Peter Mueller 2018-02-16 21:13:52 UTC
Created attachment 110734 [details]
Example psd which crashes after save and open

My steps:

(1) Start Krita and open this file
(2) Save-as <new>.psd
(3) Close Krita.
(4) Start Krita and open <new>.psd leads to internal error
Comment 2 Peter Mueller 2018-02-16 22:10:42 UTC
Just found out, that the problem comes with having layers in the .psd which have an empty name. When you load the provided image, all layer names are blank. It works, if you give every layer a name.

Hope this helps. Seems that writing cannot cope with layers with no name.

BR

Peter
Comment 3 Halla Rempt 2018-02-17 12:45:38 UTC
Hi Peter,

I can confirm the issue.
Comment 4 Halla Rempt 2018-02-17 13:27:20 UTC
*** Bug 366343 has been marked as a duplicate of this bug. ***
Comment 5 Halla Rempt 2018-02-20 07:12:03 UTC
Looks like I cannot create layers with an empty name in Photoshop itself...
Comment 6 Halla Rempt 2018-02-20 07:12:45 UTC
Or Gimp...
Comment 7 Halla Rempt 2018-02-20 07:18:29 UTC
Git commit 4c31962dd75f0087824ce4c0eace5cabfc0d2098 by Boudewijn Rempt.
Committed on 20/02/2018 at 07:17.
Pushed by rempt into branch 'master'.

PSD: save layers with an empty name as "Unnamed Layer"

Photoshop does not support layers with no names; you cannot
even create them in Photoshop. Saving layers to PSD with an
empty name results in an invalid PSD file, so subsitute
"Unnamed Layer".

M  +1    -1    plugins/impex/psd/psd_layer_section.cpp

https://commits.kde.org/krita/4c31962dd75f0087824ce4c0eace5cabfc0d2098
Comment 8 Peter Mueller 2018-02-20 21:39:53 UTC
Thanks for the prompt reply. I've also raised a respective issue to the author of the App which produced these .psd files. So issue is addressed on both sides: krita is made more robust, artflow (the other app) is made more correct :-)

Best Regards

Peter