SUMMARY Flatten image, when used on a document with alpha inheritance used results in the deletion of all layers. STEPS TO REPRODUCE 1. Get an image with multiple layers, with alpha inheritance used in it. 2. Layers->flatten image OBSERVED RESULT All the layers dissapear, and no node is visible in the layerstack. EXPECTED RESULT Just the flattened layers. Might be caused by tyyppi's commit, but it could be anything? Noticed because my scripts broke with this.
This happens if you have the layer with the alpha inheritance in a group, on top of another layer. The bug started with 4.1.2; 4.1.1 still works fine.
*** Bug 404200 has been marked as a duplicate of this bug. ***
Created attachment 118629 [details] Test .kra file Test: 1) Select Layer 9, Layer 8 and Layer 2. 2) Make sure the active layer is Layer 2. 3) Right-click on Layer 2, select "Merge with the layer below". EXPECTED: one new layer in layer 10 that contains the merged results of the content of Layer 8 group and Layer 9. Layer 9 and Layer 8 are deleted. ACTUAL: no layers inside the group Layer 10 (data loss). This looks like a different issue but actually is caused by the same issue in the code. This file is based on the file attached to the bug 404200.
Git commit 27947095edb13f17e88e6db3add682ee33345b0b by Agata Cacko. Committed on 11/03/2019 at 18:17. Pushed by tymond into branch 'master'. Fix data loss after flattening the image from inside the group Summary: Before this patch, if the selected layer was inside of a group and user requested flattening of the image, all layers were deleted and no new layer with merged content appeared. This commit makes the new layer with the merged content be created and added to the layers stack. Test Plan: - testing with test file from BUG:404200 both from inside of the group (Layer 2) and outside of the group (Layer 1) - running unit tests added to the project in the patch - merging and unmerging layers in a complex file Reviewers: #krita, rempt Reviewed By: #krita, rempt Subscribers: rempt Tags: #krita Differential Revision: https://phabricator.kde.org/D19593 M +37 -6 libs/image/kis_layer_utils.cpp M +34 -0 libs/image/tests/kis_image_test.cpp https://commits.kde.org/krita/27947095edb13f17e88e6db3add682ee33345b0b
Since the problem was caused by a slightly different thing that the previous title suggested, I changed the title so future readers don't get confused. Problem happened iff the selected layer while flattening was taking place was inside of a group. As far as I know, nothing was caused specifically by alpha inheritance. If the issue persists in some cases regarding the alpha inheritance, please reopen this bug and provide more information.