Bug 387708

Summary: Folder's Layer Style is not saved tp PSD.
Product: [Applications] krita Reporter: Paul Geraskin <paulgeraskin>
Component: layer stylesAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: wishlist CC: dimula73, halla
Priority: NOR    
Version First Reported In: 3.3.2   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: test file
Test SPD file rom Paul Geraskin
cs2 erroring out
PSD file saved in Krita

Description Paul Geraskin 2017-12-08 09:51:36 UTC
Hi!

Folder's Layer Style is not saved tp PSD. But Layer's Layer Style is saved to PSD. Is it possible to save Folder Layer Style for Folders too?

https://i.imgur.com/5zHZl9Q.png

Thanks.
Comment 1 Halla Rempt 2017-12-08 10:48:56 UTC
That's kind of hard. In the versions of photoshop and psd specification that are available to us, groups cannot have a layer style, so we'd have to reverse engineer a newer psd that has a layer effect attached to the group layer.
Comment 2 Paul Geraskin 2017-12-08 11:34:55 UTC
But the latest Photoshop supports layer styles for Groups. ((
Comment 3 Paul Geraskin 2017-12-08 11:38:07 UTC
Here is 2013 video of CS6. 
https://youtu.be/2YlUgOe11OA?t=110

This guy adds Layer Style to a group.
Comment 4 Halla Rempt 2017-12-08 11:40:28 UTC
I know it does -- it's just that all I have to test with is CS2 which Adobe made available for general download, and that the file format specification doesn't specify how to add layer styles to group layers (http://www.adobe.com/devnet-apps/photoshop/fileformatashtml/)
Comment 5 Paul Geraskin 2017-12-08 14:27:29 UTC
Created attachment 109258 [details]
test file

I have added the test file.
Comment 6 Dmitry Kazakov 2017-12-08 15:20:01 UTC
I have checked the test file, it seems like PS stores the layer styles for Group Layers in a section with a special ID: 'lfxs'. The rest of the format is exactly the same.
Comment 7 Dmitry Kazakov 2017-12-08 15:22:22 UTC
Created attachment 109259 [details]
Test SPD file rom Paul Geraskin
Comment 8 Halla Rempt 2017-12-08 15:45:12 UTC
Created attachment 109260 [details]
cs2 erroring out

Just for reference, here's the error cs2 gives when loading that file.
Comment 9 Dmitry Kazakov 2017-12-08 19:10:26 UTC
Created attachment 109263 [details]
PSD file saved in Krita

Here is the patch that implements saving and loading of lfxs section for group layers:

https://phabricator.kde.org/P143

Please check if the attached file loads fine in PS. And if so, I will push it into master.
Comment 10 Dmitry Kazakov 2017-12-08 19:23:18 UTC
Git commit b34869aca4b645529949c83b485d393931ee612f by Dmitry Kazakov.
Committed on 08/12/2017 at 19:22.
Pushed by dkazakov into branch 'kazakov/lazy-brush-remastered'.

PSD: Implement loading and saving of layer styles for group layers

Photoshop seem to use a special tag for layer styles when used in
the group layers.

M  +6    -3    plugins/impex/psd/psd_additional_layer_info_block.cpp
M  +1    -1    plugins/impex/psd/psd_additional_layer_info_block.h
M  +3    -2    plugins/impex/psd/psd_layer_record.cpp
M  +1    -1    plugins/impex/psd/psd_layer_record.h
M  +2    -1    plugins/impex/psd/psd_layer_section.cpp
M  +6    -0    plugins/impex/psd/psd_loader.cpp

https://commits.kde.org/krita/b34869aca4b645529949c83b485d393931ee612f
Comment 11 Dmitry Kazakov 2017-12-08 19:24:43 UTC
Git commit 69f35b85e03fb8fa3da34dd6dc0305f397f5f499 by Dmitry Kazakov.
Committed on 08/12/2017 at 19:24.
Pushed by dkazakov into branch 'master'.

PSD: Implement loading and saving of layer styles for group layers

Photoshop seem to use a special tag for layer styles when used in
the group layers.

M  +6    -3    plugins/impex/psd/psd_additional_layer_info_block.cpp
M  +1    -1    plugins/impex/psd/psd_additional_layer_info_block.h
M  +3    -2    plugins/impex/psd/psd_layer_record.cpp
M  +1    -1    plugins/impex/psd/psd_layer_record.h
M  +2    -1    plugins/impex/psd/psd_layer_section.cpp
M  +6    -0    plugins/impex/psd/psd_loader.cpp

https://commits.kde.org/krita/69f35b85e03fb8fa3da34dd6dc0305f397f5f499
Comment 12 Paul Geraskin 2017-12-09 09:04:37 UTC
Thank you friends!
Comment 13 Halla Rempt 2017-12-22 12:47:51 UTC
Git commit 4d7684291822db6435255b85377ab1409a729a1c by Boudewijn Rempt, on behalf of Dmitry Kazakov.
Committed on 22/12/2017 at 12:46.
Pushed by rempt into branch 'krita/3.3'.

PSD: Implement loading and saving of layer styles for group layers

Photoshop seem to use a special tag for layer styles when used in
the group layers.

M  +6    -3    plugins/impex/psd/psd_additional_layer_info_block.cpp
M  +1    -1    plugins/impex/psd/psd_additional_layer_info_block.h
M  +3    -2    plugins/impex/psd/psd_layer_record.cpp
M  +1    -1    plugins/impex/psd/psd_layer_record.h
M  +2    -1    plugins/impex/psd/psd_layer_section.cpp
M  +6    -0    plugins/impex/psd/psd_loader.cpp

https://commits.kde.org/krita/4d7684291822db6435255b85377ab1409a729a1c