Bug 462185 - Pasting bugs confusion with reference images.
Summary: Pasting bugs confusion with reference images.
Status: CONFIRMED
Alias: None
Product: krita
Classification: Applications
Component: Scripting (show other bugs)
Version: 5.1.3
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2022-11-24 00:52 UTC by keyth_qcfx2
Modified: 2023-01-11 20:26 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Crash Log for the paste event (26.60 KB, text/plain)
2022-11-27 02:47 UTC, keyth_qcfx2
Details

Note You need to log in before you can comment on or make changes to this bug.
Description keyth_qcfx2 2022-11-24 00:52:39 UTC
SUMMARY
so some pasting actions in Python are quite broken.


STEPS TO REPRODUCE
1. Copy some image into the clipboard with ctrl+c
2. use one of the follow codes on the scripter

"""
import krita
Krita.instance().action('edit_paste').trigger()
"""
"""
import krita
Krita.instance().action('paste_into').trigger()
"""

OBSERVED RESULT
What each block of code does:
1 - Creates a reference object on canvas.
2 - Causes an Instant CRASH on the application.

EXPECTED RESULT
What each block of code should do:
1 - create a paint or vector layer with the information in the clipboard.
2 - well not crash the application.

SOFTWARE/OS VERSIONS
Windows:  w10
Qt Version: 5.12.12
Comment 1 amyspark 2022-11-25 01:47:45 UTC
Hi! Could you attach the crash log, to see if the backtrace got logged?

https://docs.krita.org/en/reference_manual/sharing_krita_logs.html#getting-backtrace
Comment 2 keyth_qcfx2 2022-11-27 02:47:50 UTC
Created attachment 154071 [details]
Crash Log for the paste event

I created the crash event and then saved the log.
Comment 3 Bug Janitor Service 2022-11-27 05:12:46 UTC
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.
Comment 4 Halla Rempt 2022-12-08 14:02:56 UTC
The second part, the crash, is a duplicate of https://bugs.kde.org/show_bug.cgi?id=462223
Comment 5 Halla Rempt 2022-12-08 14:08:52 UTC
I cannot reproduce the first part of this bug report (in future, please make separate reports for different issues, please). I always get a paint layer.
Comment 6 keyth_qcfx2 2022-12-11 10:47:53 UTC
I was investigating the first (1) error and I think I found a better way to trigger it:

STEPS TO REPRODUCE
1.  Create a new Krita instance and a new document 
2. Copy something to the clipboard manually
3. Run one of the following codes for different results

"""
import krita
Krita.instance().action('edit_paste').trigger()
Krita.instance().action('edit_paste').trigger()
Krita.instance().action('paste_as_reference').trigger()
"""
creates 2 paint layers and 1 reference layer


"""
import krita
Krita.instance().action('edit_paste').trigger()
Krita.instance().action('paste_as_reference').trigger()
Krita.instance().action('edit_paste').trigger()
"""
creates 1 paint layers and 2 reference layer


"""
import krita
Krita.instance().action('paste_as_reference').trigger()
Krita.instance().action('edit_paste').trigger()
Krita.instance().action('edit_paste').trigger()
"""
creates 0 paint layers and 3 reference layer

CONCLUSION
After a "paste_as_reference" action is done the "edit_paste" becomes a reference layer too instead of paint layer.
Comment 7 forzafanplacek 2022-12-15 23:17:38 UTC
Krita crashing after pasting stuff.
Comment 8 Halla Rempt 2023-01-06 11:39:29 UTC
5.15 TEST
Comment 9 wolthera 2023-01-11 20:26:36 UTC
I can confirm comment 6 with the Krita Version: 5.2.0-prealpha (git 5c98a72) Appimage with Qt 5.15.7. Considering the crash portion is fixed, let's update the bug.