Bug 125785 - Pasting PNG images from the clipboard cause a long loop with no result
Summary: Pasting PNG images from the clipboard cause a long loop with no result
Status: RESOLVED NOTOURBUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.0.7.3 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-06-07 15:01 UTC by Richard Elkins
Modified: 2019-06-23 17:21 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Sample PNG 303kB (295.82 KB, image/png)
2019-06-07 15:04 UTC, Richard Elkins
Details
ODT file which cannot be pasted into from clipboard (33.49 KB, application/vnd.oasis.opendocument.text)
2019-06-07 19:06 UTC, Richard Elkins
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Elkins 2019-06-07 15:01:41 UTC
Description:
Running Ubuntu 18.04.2 LTS libreoffice-writer 1:6.0.7-0ubuntu0.18.04.6.
This is not a new issue; I've experienced it on earlier versions of Ubuntu & Libreoffice.

I take a screenshot in another application like Chrome.  Save to the clipboard.  If they are "small" (E.g. < 300kB), then I can paste them into Writer without issues.  

However, there is some threshold past which where Writer will go into an uninterruptible loop.  I have to wait ~60 seconds before it stops looping and it does not complete the paste.  On the other hand, for the same sized screenshot image, if I first save it to a file and then insert the PNG from the Image drop-down, then my image is incorporated as expected.

Writer should not loop on a clipboard paste.  If a paste is somehow beyond capacity, then the user would prefer a diagnostic.

Preferred action: Image insertion into the document logic should be used for clipboard image pastes.

Steps to Reproduce:
1. Launch Writer with a 5-page document.
2. Launch Chrome.
3. In Chrome, find a screen with a lot of colorful detail.
4. Take a screenshot of a region which will produce about 400kB of PNG data.
5. Copy the captured region into the clipboard.
6. Paste into the Writer document.

Actual Results:
Looping for about 60 seconds.
The paste is unsuccessful at the end of the loop.

Expected Results:
The pasted image immediately appears in the Writer document.


Reproducible: Always


User Profile Reset: No



Additional Info:
[Information automatically included from LibreOffice]
Locale: en-US
Module: TextDocument
[Information guessed from browser]
OS: Linux (All)
OS is 64bit: yes

Version: 6.0.7.3
Build ID: 1:6.0.7-0ubuntu0.18.04.6
CPU threads: 2; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: en-US (en_US.UTF-8); Calc: group
Comment 1 Richard Elkins 2019-06-07 15:04:44 UTC
Created attachment 152030 [details]
Sample PNG 303kB

The attachment (created by a region screenshot) could not be pasted directly from the clipboard into a Writer document.  However, it could be incorporated using Image > Insert.
Comment 2 Dieter 2019-06-07 15:34:54 UTC
I can't confirm it with

Version: 6.3.0.0.beta1 (x64)
Build ID: a187af327633f5f00363be5131bd21a13e0f1a7b
CPU threads: 4; OS: Windows 10.0; UI render: GL; VCL: win; 
Locale: en-US (de_DE); UI-Language: en-GB
Calc: threaded

It took 1 sec.

Richard, it seems you're using an old version of LibreOffice. Could you please try to reproduce it with the latest version of LibreOffice from https://www.libreoffice.org/download/libreoffice-fresh/ ? I have set the bug's status to 'NEEDINFO'. Please change it back to 'UNCONFIRMED' if the bug is still present in the latest version. Change to RESOLVED WORKSFORME, if the problem went away.
Comment 3 Richard Elkins 2019-06-07 19:05:16 UTC
Dieter,

Installed from web site (download, deb).
Still an anomaly.  Help now tells me
Version: 6.2.4.2
Build ID: 2412653d852ce75f65fbfa83fb7e7b669a126d64
CPU threads: 2; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: en-US (en_US.UTF-8); UI-Language: en-US
Calc: threaded

Try this, please precisely:
1. Go to URL https://www.coursera.org/specializations/gis-mapping-spatial-analysis
2. Select the whole image (3 people) on the right and copy to the clipboard.
3. Paste it into an open libreoffice Writer document.

I will add my ODT file (4.07_intermediate_mass_BH.odt).
Comment 4 Richard Elkins 2019-06-07 19:06:08 UTC
Created attachment 152036 [details]
ODT file which cannot be pasted into from clipboard
Comment 5 Dieter 2019-06-08 06:40:50 UTC
No problem for me to paste picture from comment 3 in your document. Perhaps anyone else can confirm your report (perhaps Linux only?).
Comment 6 Richard Elkins 2019-06-08 15:21:48 UTC
Just now I was not able to reproduce this issue with Libreoffice 4.3.something using my wife's Mac.  Maybe it is an issue with one of the GTK or Gnome related packages E.g. libreoffice-gtk*, libreoffice-gnome.

I am going to try reinstalling all of libreoffice solely from the web site after throwing away all the settings in my home directory. Ugh.
Comment 7 Richard Elkins 2019-06-08 17:02:08 UTC
First of all, I neglected to state earlier than I am using Xubuntu and the Xfce4 desktop (Gnome-ish, GTK-based, but different).

My instructions for comment 3 are incorrect (apologies).  I just followed the comment 3 instructions as stated and no such anomaly appears.  That's also what I did earlier with my wife's Mac.

The problem is in step #2:  Right-click followed by "copy image" does allow the paste operation to work.  True.  However, I am using the Xfce4 Screenshot application (xfce4-screenshooter 1.8.2-2) to first copy the image to the clipboard; that fails as I described.

Why am I using a screenshot application you might ask?

Answer: In on-line courses that I take, there are times when I pause the video to take a screenshot of a region of the video window to copy and paste into the lecture transcript (E.g. a formula, an image of a rock formation).

In a nutshell: Both operations copy to the clipboard but Xfce4 Screenshot with large-ish PNG images cause libreoffice to fail on the subsequent paste.  Something is going wrong in the clipboard.  It might be a corrupted clipboard image or it might be libreoffice failing on a boundary condition (?).

Could someone please try what I am doing in Windows AND in another Linux distro?
* Open the libreoffice Writer document in comment 4.
* In your favorite browser, go to URL https://www.coursera.org/specializations/gis-mapping-spatial-analysis
* Launch/invoke your OS screenshot application/widget/whatever.
* Snapshot the region of the whole image (3 people) on the right.
* Save the snapshot to the clipboard (not as a user disk file).
* Switch to the Libreoffice Writer window.
* Paste the clipboard contents into the open document.

Thank you very much.
Comment 8 Dieter 2019-06-09 07:12:59 UTC
(In reply to Richard Elkins from comment #7)
> Could someone please try what I am doing in Windows AND in another Linux
> distro?
> * Open the libreoffice Writer document in comment 4.
> * In your favorite browser, go to URL
> https://www.coursera.org/specializations/gis-mapping-spatial-analysis
> * Launch/invoke your OS screenshot application/widget/whatever.
> * Snapshot the region of the whole image (3 people) on the right.
> * Save the snapshot to the clipboard (not as a user disk file).
> * Switch to the Libreoffice Writer window.
> * Paste the clipboard contents into the open document.

Still no problem for me. Perhaps someone else can help you.
Comment 9 Telesto 2019-06-09 09:41:59 UTC
I would start with updating to LibreOffice 6.2.x (or even LibO6.3b1); LibO 6.0.7.3 reached end of life.
Comment 10 Richard Elkins 2019-06-10 13:01:32 UTC
Telesto,

I did test with the latest stable (comment 3) and the same result occurred.

As I said in comment 7, it seems to be related to the Xfce4 Screenshot application.  It might be a corrupted clipboard image created by Xfce4 Screenshot or it might be libreoffice failing on a boundary condition.

As soon as time permits, I will try this on another Linux desktop.
Comment 11 Richard Elkins 2019-06-23 17:21:51 UTC
Found this bug report against xfce4-screenshooter:
https://bugs.launchpad.net/xfce4-settings/+bug/1655398

Folks have reported similar symptoms with pasting to other types of documents.

I will mark this report as "RESOLVED"/"NOTOURBUG" here.