Bug 438426 - Issue with copy-paste image from Chromium based browser (Chrome, Edge) on Nightly Build
Summary: Issue with copy-paste image from Chromium based browser (Chrome, Edge) on Nig...
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Unclassified
Component: General (show other bugs)
Version: nightly build (please specify the git hash!)
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: amyspark
URL:
Keywords: regression
: 440944 (view as bug list)
Depends on:
Blocks: 447428
  Show dependency treegraph
 
Reported: 2021-06-10 15:37 UTC by idaeroace
Modified: 2022-01-03 23:11 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
The error shown when paste image (105.27 KB, image/png)
2021-06-10 15:37 UTC, idaeroace
Details
Krita System Infomation (2.43 KB, text/plain)
2021-06-10 15:40 UTC, idaeroace
Details
Krita Usage Log (288.95 KB, application/vnd.rar)
2021-06-10 15:45 UTC, idaeroace
Details

Note You need to log in before you can comment on or make changes to this bug.
Description idaeroace 2021-06-10 15:37:41 UTC
Created attachment 139206 [details]
The error shown when paste image

SUMMARY
I'm using the latest June 10 Nightly build (c4e3b84904)

I (and 2 other users on krita-artist) can't copy-paste any image from Chromium based browser (Chrome, Edge, Vivaldi, Brave) into Krita. Copy-paste from other browser like Mozila Firefox and Palemoon works fine. Also still works fine on 4.4.3

Last time I'm able to copy-paste from Edge was on June 2, using May 28 Nightly build (56d09e2386). But now, even if I try using older nightly version, it's also not working.

STEPS TO REPRODUCE
1. Copy any image using Edge or Chrome
2. Paste in Krita (Ctrl+V or using Edit menu)
3. Error pop up, says "Could not download : Protocol "" is unknown"

ANOTHER RELATED ISSUE
And related another issue. Still about copying image from Chromium. Using Edit - Paste as Reference Image is working fine. But Ctrl+V then Insert as Reference Image give the same error. 

Here is the issue. After I use Edit - Paste as Reference Image twice, using any choice on Ctrl+V will give same error, but it create Reference Image. Even when I choose "Cancel"

STEPS TO REPRODUCE
1. Copy any image using Edge or Chrome
2. Go to Edit menu, Paste as Reference Image. Do this twice
3. Press Ctrl+V, and choose any option
4. Error pop up, says "Could not download : Protocol "" is unknown", but new Reference Image will be created, even if choose Cancel
Comment 1 idaeroace 2021-06-10 15:40:45 UTC
Created attachment 139207 [details]
Krita System Infomation
Comment 2 idaeroace 2021-06-10 15:45:26 UTC
Created attachment 139208 [details]
Krita Usage Log

Inside rar because it's too large
Comment 3 Ahab Greybeard 2021-06-10 16:26:45 UTC
This was first reported at: https://krita-artists.org/t/cant-copy-paste-image-from-chromium-chrome-and-edge-to-krita-nightly-build/24960

I can confirm this for the Jun 10 5.0.0-prealpha git c4e3b84904) portable .zip on Windows 10.
Tested with Palemoon and Edge. Palemoon gave no problems but Edge was as described in the report.

Further, for 'Another Related Issue', I found that Step 2, wasn't needed. If I pasted with Ctrl+V and chose Insert as New Layer, it pasted as a reference image after I Cancelled the error message.

This problem does not happen for the 4.4.3 installed version with the Edge browser, hence regression.
Comment 4 Dmitry Kazakov 2021-07-22 05:52:39 UTC
Git commit 5cc93f9c947b27dd1c855449d0053d3a0321a93d by Dmitry Kazakov.
Committed on 22/07/2021 at 05:52.
Pushed by dkazakov into branch 'master'.

Fix loading of remote documents dropped to the canvas

The temporary file should still be alive when we read from it
some time later.

M  +5    -2    libs/ui/utils/KisClipboardUtil.cpp

https://invent.kde.org/graphics/krita/commit/5cc93f9c947b27dd1c855449d0053d3a0321a93d
Comment 5 Dmitry Kazakov 2021-07-30 05:14:52 UTC
The issue is reported to Chrome:

https://bugs.chromium.org/p/chromium/issues/detail?id=1231533

Though we should probably reconsider our strategy on download/use-paste decision making.
Comment 6 Alvin Wong 2021-08-01 07:09:56 UTC
I think it shouldn't just silently decide to download from the URL. Maybe showing a message box with the URL and a clipboard image preview, with the options to choose between download or using the clipboard image directly would be better?
Comment 7 Halla Rempt 2021-08-16 10:51:02 UTC
*** Bug 440944 has been marked as a duplicate of this bug. ***
Comment 8 Yu-Hsuan Lai 2021-09-04 07:03:52 UTC
Similar issue for me with 5.0.0-beta1. It seems to always try to download from the URL.
Comment 9 Bug Janitor Service 2021-11-25 14:12:16 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/krita/-/merge_requests/1177
Comment 10 Bug Janitor Service 2021-11-29 02:53:22 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/krita/-/merge_requests/1185
Comment 11 amyspark 2021-11-29 09:25:16 UTC
Git commit 4c84bd46409febdb0a411e056dfdd6fa1af80cc4 by L. E. Segovia.
Committed on 29/11/2021 at 02:51.
Pushed by dkazakov into branch 'krita/5.0'.

Fix failed cancellation of paste events

M  +11   -9    libs/ui/kis_clipboard.cc

https://invent.kde.org/graphics/krita/commit/4c84bd46409febdb0a411e056dfdd6fa1af80cc4
Comment 12 Dmitry Kazakov 2021-11-29 09:27:08 UTC
Git commit d40853c0bc7eee4cfa7303e2892a1dac171d08b1 by Dmitry Kazakov, on behalf of L. E. Segovia.
Committed on 29/11/2021 at 09:26.
Pushed by dkazakov into branch 'master'.

Fix failed cancellation of paste events

M  +11   -9    libs/ui/kis_clipboard.cc

https://invent.kde.org/graphics/krita/commit/d40853c0bc7eee4cfa7303e2892a1dac171d08b1