<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>458890</bug_id>
          
          <creation_ts>2022-09-08 18:09:35 +0000</creation_ts>
          <short_desc>Krita hangs after copying pixels, then pasting into other application</short_desc>
          <delta_ts>2022-09-16 13:12:50 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Applications</classification>
          <product>krita</product>
          <component>General</component>
          <version>5.1.0</version>
          <rep_platform>Appimage</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>triaged</keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter>rebuilderster</reporter>
          <assigned_to name="Dmitry Kazakov">dimula73</assigned_to>
          <cc>halla</cc>
          
          <cf_commitlink>https://invent.kde.org/graphics/krita/commit/1d9698635a0f8289263bcb057727bf69cb48e8fa</cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2151173</commentid>
    <comment_count>0</comment_count>
    <who name="">rebuilderster</who>
    <bug_when>2022-09-08 18:09:35 +0000</bug_when>
    <thetext>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): &quot;qAbs(row) &lt; 0x7FFF &amp;&amp; qAbs(col) &lt; 0x7FFF&quot; 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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2151192</commentid>
    <comment_count>1</comment_count>
    <who name="">rebuilderster</who>
    <bug_when>2022-09-08 18:53:08 +0000</bug_when>
    <thetext>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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2151980</commentid>
    <comment_count>2</comment_count>
    <who name="Halla Rempt">halla</who>
    <bug_when>2022-09-12 09:27:12 +0000</bug_when>
    <thetext>I don&apos;t have Mint to test with. This works fine on my Plasma desktop, though.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2153188</commentid>
    <comment_count>3</comment_count>
    <who name="Dmitry Kazakov">dimula73</who>
    <bug_when>2022-09-16 11:08:25 +0000</bug_when>
    <thetext>Git commit aac9375843b3018564cea285b91f82c7f3b9fda2 by Dmitry Kazakov.
Committed on 16/09/2022 at 11:07.
Pushed by dkazakov into branch &apos;master&apos;.

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&apos;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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2153193</commentid>
    <comment_count>4</comment_count>
    <who name="Dmitry Kazakov">dimula73</who>
    <bug_when>2022-09-16 11:09:24 +0000</bug_when>
    <thetext>Git commit 1d9698635a0f8289263bcb057727bf69cb48e8fa by Dmitry Kazakov.
Committed on 16/09/2022 at 11:09.
Pushed by dkazakov into branch &apos;krita/5.1&apos;.

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&apos;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</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>