Bug 403816

Summary: it is possible to add a kra file as a file layer with D&D
Product: [Applications] krita Reporter: Raghavendra kamath <raghu>
Component: UsabilityAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: freebox64, griffinvalley, halla
Priority: NOR    
Version: git master (please specify the git hash!)   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Raghavendra kamath 2019-02-01 05:01:12 UTC
SUMMARY
It is possible to add a Kra file as a file layer, you can already add it now by drag and drop operation and selecting insert as file layer from the context menu. But when you try to insert a .kra file through the file layer menu from the layer stack + button, even though the resulting file dialog has all supported file format selected, kra file is not shown in there. so users think that kra file is not supported to be added as a file layer, unless they add it by drag and drop.

STEPS TO REPRODUCE
1. Create a test kra file save it in some location
2. create a new file and try to add the test kra file as a file layer through the layer stack menu


OBSERVED RESULT
the file selector hides kra file

EXPECTED RESULT
kra file should be displayed with other supported format
Comment 1 mvowada 2019-02-01 07:33:50 UTC
Hi. Yes, in both 4.2.0-pre-alpha (git 0285643) and 4.1.7 Krita versions (appimages).
Comment 2 Halla Rempt 2019-02-01 08:53:59 UTC
Well, that's intentional. Using kra files as file layers is not supported and can lead to very strange bugs.
Comment 3 mvowada 2019-02-01 09:33:17 UTC
I think it is for Bug 325686?
"Nesting .kra files is dangerous, since a .kra file can contain file layers itself, which is not supported"
Comment 4 Halla Rempt 2019-02-01 09:39:55 UTC
Exactly
Comment 5 Raghavendra kamath 2019-02-01 09:41:18 UTC
I think we should either remove ability to drag and drop kra files as file layers or implement having kra file as file layer but with last mergedimage.png of the file layer, (sorry for sounding silly) or some other way to tackle this issue.
Comment 6 mvowada 2019-02-01 10:02:57 UTC
I'd prefer case 2: "with last mergedimage.png", as long as png suits the needs. 
At least one doesn't have to open the .kra document and export, which can be tedious in particular if it's a large file.
Comment 7 Halla Rempt 2019-02-01 10:11:50 UTC
Git commit c0a8eea085e151bcb9fc2911a7033c83ad945caa by Boudewijn Rempt.
Committed on 01/02/2019 at 10:11.
Pushed by rempt into branch 'master'.

Open the mergedimage.png for ora or kra file layers

M  +1    -1    libs/store/KoQuaZipStore.cpp
M  +1    -1    libs/ui/KisWelcomePageWidget.cpp
M  +0    -2    libs/ui/dialogs/kis_dlg_file_layer.cpp
M  +32   -32   libs/ui/kis_layer_manager.cc
M  +34   -11   libs/ui/kis_safe_document_loader.cpp
M  +3    -2    libs/ui/kis_safe_document_loader.h

https://commits.kde.org/krita/c0a8eea085e151bcb9fc2911a7033c83ad945caa
Comment 8 mvowada 2019-02-01 10:27:16 UTC
:) Thanks
Comment 9 wolthera 2019-02-01 10:41:50 UTC
This does mean that kra file-layers will always be sRGB because we forced the mergedimage.png to save as sRGB so deevad would have an easier time converting the kra files for P&C.
Comment 10 Raghavendra kamath 2019-02-01 10:48:22 UTC
thanks for the fix boud