SUMMARY Krita crashes when pasting a null/empty image with the following error: ASSERT (krita): "!qimage.isNull()" in file /usr/src/debug/krita/krita-5.1.5/libs/ui/kis_clipboard.cc, line 460 It is 100% reproducible and it also happened in other cases but didn't know how to reproduce it. STEPS TO REPRODUCE 1. Select layer with "inherit alpha" enabled 2. Press Ctrl+C 3. Press Ctrl+Shift+N OBSERVED RESULT Krita crashes after this. It works if "Inherit Alpha" is disabled EXPECTED RESULT Krita should create a new canvas with the layer pasted. SOFTWARE/OS VERSIONS Linux/KDE Plasma: 5.15.89-1-MANJARO (available in About System) KDE Plasma Version: KDE Frameworks Version: Qt Version: 5.15.8 ADDITIONAL INFORMATION
I'll check this out.
This is a case of the infamous "clipboard is cleared midway into pasting". In your case, it is caused by selecting "paste from clipboard" in the source selection dialog, but then something in between clears the clipboard. So when the image is fetched from the clipboard, a null QImage is returned, and that doesn't match the expected state. If you can reproduce it consistently, can you check if you have a password manager active, or something that regularly cleans your clipboard?
No, there shouldn't be something like that. But that doesn't explain why it works normally if "Inherit alpha" is disabled. It only crashes when I copy a layer with inherit alpha. Is it not reproducible on your side? I could try it on other machines to check if it's only on my current one.
Yes, I have 5.1.5 and current master on Windows and neither crash when copying a layer with Inherit Alpha, even after closing the source document.
Thanks for your comment! Automatically switching the status of this bug to REPORTED so that the KDE team knows that the bug is ready to get confirmed. In the future you may also do this yourself when providing needed information.
So what I have tested now is: - In Windows (VM): nothing happens - In another Linux machine: nothing happens I guess the normal behaviour is that nothing should happen when I paste an inherit alpha layer as a new document. Pasting in the same documents works normally. My initial guess that it might be a Linux problem doesn't seem to be the case. It only occurs on my main Linux machine. So this bug doesn't seem to be very important and is also a pretty rare use case, so I will close it for now. Thanks for looking into it though!