Bug 458890

Summary: Krita hangs after copying pixels, then pasting into other application
Product: [Applications] krita Reporter: rebuilderster
Component: GeneralAssignee: Dmitry Kazakov <dimula73>
Status: RESOLVED FIXED    
Severity: normal CC: halla
Priority: NOR Keywords: triaged
Version: 5.1.0   
Target Milestone: ---   
Platform: Appimage   
OS: Linux   
Latest Commit: Version Fixed In:

Description rebuilderster 2022-09-08 18:09:35 UTC
Whenever I copy an image from Krita and try to paste it in another application, the image fails to paste and Krita hangs.


STEPS TO REPRODUCE
1. Create new image, say 512x512, 8-bit colours, one layer
2. scribble something on the canvas with a brush tool
3. press ctrl-a to select all, then ctrl-c to copy
4. In another application, in my case either pureref or Firefox, press ctrl-v to paste

OBSERVED RESULT
Krita hangs. Console output repeats the following many times:
SAFE ASSERT (krita): "qAbs(row) < 0x7FFF && qAbs(col) < 0x7FFF" in file /home/appimage/workspace/Krita_Release_Appimage_Build/krita/libs/image/tiles3/kis_tile_hash_table2.h, line 151


EXPECTED RESULT


SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Linux Mint 20.2
Comment 1 rebuilderster 2022-09-08 18:53:08 UTC
Further info: This only seems to happen when copying from the Background layer. If doing a copy merged when other layers are in the layer stack, or copying from some other layer than background, the bug does not occur.
Comment 2 Halla Rempt 2022-09-12 09:27:12 UTC
I don't have Mint to test with. This works fine on my Plasma desktop, though.
Comment 3 Dmitry Kazakov 2022-09-16 11:08:25 UTC
Git commit aac9375843b3018564cea285b91f82c7f3b9fda2 by Dmitry Kazakov.
Committed on 16/09/2022 at 11:07.
Pushed by dkazakov into branch 'master'.

Fix a crash when trying to copy-paste the background layer

Such layers usually have non-transparent default pixel, which
automatically needs an image for exact bounds calculation, which
doesn't exist for the detached layers.

The patch saves the copied area bounds on the construction
of mime data, much before the layers become detached.
Related: bug 458857, bug 458248, bug 458941

M  +12   -11   libs/ui/kis_mimedata.cpp
M  +2    -0    libs/ui/kis_mimedata.h

https://invent.kde.org/graphics/krita/commit/aac9375843b3018564cea285b91f82c7f3b9fda2
Comment 4 Dmitry Kazakov 2022-09-16 11:09:24 UTC
Git commit 1d9698635a0f8289263bcb057727bf69cb48e8fa by Dmitry Kazakov.
Committed on 16/09/2022 at 11:09.
Pushed by dkazakov into branch 'krita/5.1'.

Fix a crash when trying to copy-paste the background layer

Such layers usually have non-transparent default pixel, which
automatically needs an image for exact bounds calculation, which
doesn't exist for the detached layers.

The patch saves the copied area bounds on the construction
of mime data, much before the layers become detached.
Related: bug 458857, bug 458248, bug 458941


(cherry picked from commit aac9375843b3018564cea285b91f82c7f3b9fda2)

M  +12   -11   libs/ui/kis_mimedata.cpp
M  +2    -0    libs/ui/kis_mimedata.h

https://invent.kde.org/graphics/krita/commit/1d9698635a0f8289263bcb057727bf69cb48e8fa