Bug 396224

Summary: layer styles are not applied when exporting as png or jpg
Product: [Applications] krita Reporter: eggy.sock
Component: File formatsAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: dimula73, eggy.sock, halla
Priority: NOR    
Version: 4.1.0 alpha   
Target Milestone: ---   
Platform: Other   
OS: Microsoft Windows   
Latest Commit: Version Fixed In:
Attachments: example save file

Description eggy.sock 2018-07-05 20:54:11 UTC
Created attachment 113788 [details]
example save file

Hello,

I'm currently running the latest 4.1 release downloaded from the main website on windows 8.1

I've tested a couple of different layer styles and they don't seem to be being applied when exporting the image (I tried .png and .jpg and both have the same problem)

Here is a file I have been working on, as an example. On my computer the exported image is in black & white as the colour is added via a color overlay
Comment 1 eggy.sock 2018-07-05 20:58:09 UTC
I forgot to mention that this was working as normal in the 4.0.4 release
Comment 2 Halla Rempt 2018-07-10 13:01:57 UTC
Hi,

I can confirm the bug.
Comment 3 eggy.sock 2018-07-12 08:25:06 UTC
Have also noticed this issue affects the mergedImage.png inside .kra save files, if that helps at all.
Comment 4 Dmitry Kazakov 2018-07-15 16:15:57 UTC
I have checked the bug: it happens because we do neither duplicate layer styles cached projections nor recalculate them after the image is copied. The effect is usually not seen, because we just copy projection of the root node and use it to save a PNG... But not in the case of the example file in the bugreport, the file has a shape layer... Shape layer tries to update itself after the copying and broken projection of the layers styles shows itself.

** Workaround until I fix the issue: **
Just rasterize all shapes layers and transformation masks before saving the image. Then the bug will not be visible :)
Comment 5 Dmitry Kazakov 2018-07-23 12:57:22 UTC
Git commit 5b02447d06788d289f79581ff8cec4679804ab01 by Dmitry Kazakov.
Committed on 23/07/2018 at 12:54.
Pushed by dkazakov into branch 'kazakov/realtime-selections'.

Fix saving layers with layer styles

We should deep copy the layer style projections
when cloning the image. Otherwise shape layers and
other delayed update nodes might cause rerender of
the layers stack and lacking layers styles will become
visible in the saved image.

M  +15   -6    libs/image/kis_layer.cc
M  +7    -0    libs/image/layerstyles/kis_layer_style_filter.cpp
M  +5    -0    libs/image/layerstyles/kis_layer_style_filter.h
M  +24   -4    libs/image/layerstyles/kis_layer_style_filter_projection_plane.cpp
M  +4    -0    libs/image/layerstyles/kis_layer_style_filter_projection_plane.h
M  +30   -6    libs/image/layerstyles/kis_layer_style_projection_plane.cpp
M  +5    -0    libs/image/layerstyles/kis_layer_style_projection_plane.h
M  +10   -0    libs/image/layerstyles/kis_ls_bevel_emboss_filter.cpp
M  +5    -0    libs/image/layerstyles/kis_ls_bevel_emboss_filter.h
M  +10   -0    libs/image/layerstyles/kis_ls_drop_shadow_filter.cpp
M  +3    -0    libs/image/layerstyles/kis_ls_drop_shadow_filter.h
M  +9    -0    libs/image/layerstyles/kis_ls_overlay_filter.cpp
M  +4    -0    libs/image/layerstyles/kis_ls_overlay_filter.h
M  +10   -0    libs/image/layerstyles/kis_ls_satin_filter.cpp
M  +5    -0    libs/image/layerstyles/kis_ls_satin_filter.h
M  +10   -0    libs/image/layerstyles/kis_ls_stroke_filter.cpp
M  +4    -0    libs/image/layerstyles/kis_ls_stroke_filter.h
M  +17   -0    libs/image/layerstyles/kis_multiple_projection.cpp
M  +1    -0    libs/image/layerstyles/kis_multiple_projection.h

https://commits.kde.org/krita/5b02447d06788d289f79581ff8cec4679804ab01
Comment 6 Dmitry Kazakov 2018-07-23 12:58:10 UTC
Git commit 917f921c11d221a05bccbe333426ae4d01690456 by Dmitry Kazakov.
Committed on 23/07/2018 at 12:57.
Pushed by dkazakov into branch 'krita/4.1'.

Fix saving layers with layer styles

We should deep copy the layer style projections
when cloning the image. Otherwise shape layers and
other delayed update nodes might cause rerender of
the layers stack and lacking layers styles will become
visible in the saved image.

M  +15   -6    libs/image/kis_layer.cc
M  +7    -0    libs/image/layerstyles/kis_layer_style_filter.cpp
M  +5    -0    libs/image/layerstyles/kis_layer_style_filter.h
M  +24   -4    libs/image/layerstyles/kis_layer_style_filter_projection_plane.cpp
M  +4    -0    libs/image/layerstyles/kis_layer_style_filter_projection_plane.h
M  +30   -6    libs/image/layerstyles/kis_layer_style_projection_plane.cpp
M  +5    -0    libs/image/layerstyles/kis_layer_style_projection_plane.h
M  +10   -0    libs/image/layerstyles/kis_ls_bevel_emboss_filter.cpp
M  +5    -0    libs/image/layerstyles/kis_ls_bevel_emboss_filter.h
M  +10   -0    libs/image/layerstyles/kis_ls_drop_shadow_filter.cpp
M  +3    -0    libs/image/layerstyles/kis_ls_drop_shadow_filter.h
M  +9    -0    libs/image/layerstyles/kis_ls_overlay_filter.cpp
M  +4    -0    libs/image/layerstyles/kis_ls_overlay_filter.h
M  +10   -0    libs/image/layerstyles/kis_ls_satin_filter.cpp
M  +5    -0    libs/image/layerstyles/kis_ls_satin_filter.h
M  +10   -0    libs/image/layerstyles/kis_ls_stroke_filter.cpp
M  +4    -0    libs/image/layerstyles/kis_ls_stroke_filter.h
M  +17   -0    libs/image/layerstyles/kis_multiple_projection.cpp
M  +1    -0    libs/image/layerstyles/kis_multiple_projection.h

https://commits.kde.org/krita/917f921c11d221a05bccbe333426ae4d01690456
Comment 7 Dmitry Kazakov 2018-07-23 12:59:02 UTC
Git commit 5e81de71b97fb54e4ee81b345778045c4f411f4d by Dmitry Kazakov.
Committed on 23/07/2018 at 12:58.
Pushed by dkazakov into branch 'master'.

Fix saving layers with layer styles

We should deep copy the layer style projections
when cloning the image. Otherwise shape layers and
other delayed update nodes might cause rerender of
the layers stack and lacking layers styles will become
visible in the saved image.

M  +15   -6    libs/image/kis_layer.cc
M  +7    -0    libs/image/layerstyles/kis_layer_style_filter.cpp
M  +5    -0    libs/image/layerstyles/kis_layer_style_filter.h
M  +24   -4    libs/image/layerstyles/kis_layer_style_filter_projection_plane.cpp
M  +4    -0    libs/image/layerstyles/kis_layer_style_filter_projection_plane.h
M  +30   -6    libs/image/layerstyles/kis_layer_style_projection_plane.cpp
M  +5    -0    libs/image/layerstyles/kis_layer_style_projection_plane.h
M  +10   -0    libs/image/layerstyles/kis_ls_bevel_emboss_filter.cpp
M  +5    -0    libs/image/layerstyles/kis_ls_bevel_emboss_filter.h
M  +10   -0    libs/image/layerstyles/kis_ls_drop_shadow_filter.cpp
M  +3    -0    libs/image/layerstyles/kis_ls_drop_shadow_filter.h
M  +9    -0    libs/image/layerstyles/kis_ls_overlay_filter.cpp
M  +4    -0    libs/image/layerstyles/kis_ls_overlay_filter.h
M  +10   -0    libs/image/layerstyles/kis_ls_satin_filter.cpp
M  +5    -0    libs/image/layerstyles/kis_ls_satin_filter.h
M  +10   -0    libs/image/layerstyles/kis_ls_stroke_filter.cpp
M  +4    -0    libs/image/layerstyles/kis_ls_stroke_filter.h
M  +17   -0    libs/image/layerstyles/kis_multiple_projection.cpp
M  +1    -0    libs/image/layerstyles/kis_multiple_projection.h

https://commits.kde.org/krita/5e81de71b97fb54e4ee81b345778045c4f411f4d