Bug 134031 - [EDITING]Images copied from Firefox won't paste
Summary: [EDITING]Images copied from Firefox won't paste
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
6.4.1.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-16 09:48 UTC by zzz
Modified: 2023-11-07 06:41 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description zzz 2020-06-16 09:48:25 UTC
Description:
Images copied from Firefox's "Copy Image" won't paste into worksheet.
Reproducibility 100%


Steps to Reproduce:
(1) In Firefox web browser 74.0 (64 bit on Windows10),
  open any web page. example here:
  https://www.timeanddate.com/worldclock/full.html
(2) Right-click an image and "Copy Image"
  for our example, copy the "timeanddate.com" logo on the top left.
(3) Paste into Calc by ctrl+V.


Actual Results:
No image are pasted into Calc.


Expected Results:
Image expected to be pasted on Calc worksheet.



Reproducible: Always


User Profile Reset: No



Additional Info:
Other combination test results:
(a) Firefox 74.0 (64bit) to Excel2000: success
(b) Firefox 74.0 (64bit) to IrfanView 4.54 32bit: success
(c) image of (b) from IrfanView 4.54 32bit to LibreOffice Calc 6.4.1.2 (x64): success
(d) Google Chrome 83.0.4103.61 64bit to LibreOffice Calc 6.4.1.2 (x64): success
(e) Google Chrome 83.0.4103.61 64bit to Excel2000: success
(f) Google Chrome 83.0.4103.61 64bit to IrfanView 4.54 32bit: success
Comment 1 Julien Nabet 2020-06-16 11:00:56 UTC
Could you apply what https://wiki.documentfoundation.org/QA/FirstSteps indicates?
Comment 2 zzz 2020-06-16 15:41:02 UTC
(In reply to Julien Nabet from comment #1)
> Could you apply what https://wiki.documentfoundation.org/QA/FirstSteps
> indicates?

What change in v6.3.6 made you think it may have cured this problem?
Have found nothing relevant in
https://wiki.documentfoundation.org/ReleaseNotes/6.3
https://wiki.documentfoundation.org/ReleaseNotes/6.4

Well, here's the results:
1. Updated LibreOffice v6.4.1.2(x64) to 6.4.4.2 (x64)
  -> No improvement.
2. Deleted user profile
  This page:
  https://wiki.documentfoundation.org/UserProfile#User_profile_location
  doesn't mention exactly which file/folder exactly is the profile!
  so I tried geusswork. closed app, renamed 
  AppData/Roaming/LibreOffice/4
  to
  AppData/Roaming/LibreOffice/4_
  restarted app
  -> No improvement.
3.  UI render: GL;
  changed 「すべてのレンダリングにOpenGLを使用する」 from ON to OFF 
  restarted app
  -> No improvement.
4. changed 「OpenCLを使用する」 from ON to OFF 
  restarted app
  -> No improvement.

I'd suspect there is some difference between Firefox and Libre Calc's clipboard handling.
Comment 3 zzz 2020-06-16 15:46:51 UTC
(In reply to Julien Nabet from comment #1)
> Could you apply what https://wiki.documentfoundation.org/QA/FirstSteps
> indicates?

Oops, forgot to ask my first question.
Do you mean you couldn't reproduce it, any images pasted fine in your environment?
Comment 4 QA Administrators 2020-06-17 03:51:27 UTC Comment hidden (obsolete)
Comment 5 Julien Nabet 2020-06-18 11:47:10 UTC
On Win10 with master sources updated today, I could reproduce this.

I noticed these kind of logs:
HTTP session to https://c.tadst.com:443 begins.
ssl: SNI enabled by default.
Running pre_send hooks
compress: Initialization.
Sending request headers:
GET https://c.tadst.com/gfx/n/tad-logo-com3.png HTTP/1.1
Connection: TE
TE: trailers
Host: c.tadst.com
Accept-Encoding: gzip
Pragma: no-cache
User-Agent: LibreOffice
Comment 6 Julien Nabet 2020-06-18 11:49:12 UTC
On pc Debian x86-64 with master sources updated today with gen rendering, I don't reproduce this.

I wonder why there's some ssl negotiation in Windows.
Comment 7 Timur 2022-05-17 07:57:55 UTC
From what I see, this is NotABug.
Because, there is no "Copy Image" on https://www.timeanddate.com/worldclock/full.html logo, just Copy Link, not the same. 
See bug 149087 that image can be copied where there is Copy Image. 
Also, you can copy link and Insert image from link.
Comment 8 Timur 2022-05-17 07:58:42 UTC
These meta bugs are wrong, removing.
Comment 9 zzz 2022-05-17 15:57:02 UTC
Still reproducing in Firefox 98.0.2. I want to stress that other apps accept the paste, only LibreOffice Calc fails to.
Try another website: https://www.documentfoundation.org/
Right clicking on the logo in the upper left corner "(box) LibreOffice The Document Foundation" brings up both "Copy Image" and "Copy Image link" options. Do "Copy Image" (not link).
This too fails to paste on LibreOffice Calc, but it can be pasted on LibreOffice Draw, LibreOffice Impress, IrfanView, Microsoft Windows10's Paint, Windows10's Wordpad, GIMP (This logo is white on transparent background so becomes invisible on some apps such as Wordpad, Excel 2000 and GIMP, but they are there).
When I once paste the logo on LibreOffice Draw and copy that from LibreOffice Draw, it will become pastable to LibreOffice Calc.
Same for (any) other websites, such as https://www.google.com/ large "Google", and
https://www.usinages.com/attachments/capture2-jpg.368604/
https://www.usinages.com/attachments/capture-jpg.368605/

My environment:
Version: 7.3.2.2 (x64) / LibreOffice Community
Build ID: 49f2b1bff42cfccbd8f788c8dc32c1c309559be0
CPU threads: 4; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: ja-JP (ja_JP); UI: en-US
Calc: CL

Does your Firefox/Windows Calc/Windows combination paste correctly?
Comment 10 Timur 2022-05-18 08:56:14 UTC
Let's get back to QA basics. 
Original report was NotABug. 
Then reporter sets Reopen and gives difrerent example.
See https://bugs.documentfoundation.org/page.cgi?id=fields.html#bug_status.

Comment 9 is a bug. Repro 7.4. 
That is PNG: 
Bit Depth                       : 8
Color Type                      : RGB with Alpha
Compression                     : Deflate/Inflate
Filter                          : Adaptive
Interlace                       : Noninterlaced
Background Color                : 255 255 255
Pixels Per Unit X               : 15078
Pixels Per Unit Y               : 15078

But it needs to go normal way of also looking for existing report. 
And that example seems duplicate of bug 98275.
So I set this back to NAB for original report.
Comment 11 Timur 2022-05-18 09:17:05 UTC
 zzz if you don't think it's duplicate, please explain. 
I'm aware that your report was focused to Calc but I prefer to connect problems and use that as a reason to raise priority. 
Should that bug be resolved, all duplicates need to be tested and it's easy to open a new bug for remaining problem.
Please add yourself to CC and follow there if you agree.
Comment 12 zzz 2022-05-18 16:39:23 UTC
Timur, thanks for investigating.
For practicality, merging the tracking task to bug 98275 is OK for me, as long as the issue is recognized and processed. Comment 12 (2020-08-22) in 98275 "from Firefox 79.0 / Can't paste Image... Why?" does sort of cover 134031 (although it seems not have been filed, and subsequently got ignored. Scary.).

Regardless of how it is administered, however, bug 98275's title is very different from my problem. That is why I couldn't find 98275 to be related.
(1) "PNG image": To me, problem 134031 happens regardless of file format (at least for PNG and JPG).
   e.g. https://www.usinages.com/attachments/capture-jpg.368605/ which I pasted in Comment9 says it is JPG
   also fails to paste on Calc. Haven't checked for other formats.
(2) "with alpha channel": Problem 134031 fails to paste any file, transparent or not, although I don't know about image format technicalities. The only thing I know is that "alpha channel" is somewhat related to transparent background(?). I don't even know how to find a "non-alpha channel(?)" file. Is this JPG file one of it?:
   https://www.usinages.com/attachments/capture-jpg.368605/
   this also fails to paste on Calc.
(3) "pasted from clipboard": Only this part is common with problem 134031.
(4) "has black background": I was aware of this symptom happening on Draw, but it still pastes "something". Pasting nothing at all seems a different bug to me.

Actually, the 98275 symptom was probably the reason why I initially avoided
https://www.documentfoundation.org/themes/libreofficenew/img/logo.png
https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png
as example data. That was because I was afraid that my issue would be sidestepped on the grounds that "Oh, even if the paste problem is repaired, what you get is only a dirty black box. Will you really want that?. Low priority. Bug closed. Have a nice day.", or misunderstood as another-report-of-that-same-old-black-background-problem. So I chose a random image on web that did show only the 134031 without the 98275 black background bug. My bad choice because that webpage had a separate problem, reproducibility.

Also, the browser dependency is different.
* bug 134031 is source-dependent. It happens only when the source is Firefox. Chrome or other apps works correctly as source. Comment 12 in 98275 seems to imply that bug 134031 is also dependent on Firefox's version (older Firefox pasted correctly, besides the image quality).
* bug 98275 reports (except the separate problem in Comment 12,) are unclear of whether the symptom is dependent on source apps. The example just happened to be from a browser, or unmentioned, that does not mean it only happens from browsers. In my experiment,
   * copying the LibreOffice black logo from Draw and pasting it to Writer still makes it black.
   * opening the LibreOffice logo.png from IrfanView then copy from IrfanView to Draw or Writer still makes it black.
 So I guess bug 98275 is source-independent.
Comment 13 Timur 2022-05-19 07:26:10 UTC
Sorry for these, I overlooked. You are right. 
Please report a new minor bug for Calc "Paste of JPEG from Firefox doesn't work except as Paste Special BMP" (paste from Chrome or to Writer/Impress OK).

https://www.usinages.com/attachments/capture2-jpg.368604/
https://www.usinages.com/attachments/capture-jpg.368605/
JPEG Baseline DCT, Huffman coding.

And also give example of logo from https://www.documentfoundation.org/ as not pasting to Calc from Firefox is that same bug and pasting black from Chrome is bug 98275 (so put to See Also).  


"how to find a "non-alpha channel(?)" file"
Just download and run: exiftool.exe  file.ext
Comment 14 Timur 2022-05-19 07:26:50 UTC
"Paste of image from Firefox doesn't work except as Paste Special BMP (paste from Chrome or to Writer/Impress OK)"
Comment 15 zzz 2023-11-07 03:33:21 UTC
Resolved in Calc 7.6.2.1 (X86_64) + Firefox 119.0 (64bit) for Windows + Windows 10 22H2 19045.3570

Now both of the folling images correctly pastes on Calc by ctrl+V.
https://www.usinages.com/attachments/capture2-jpg.368604/
https://www.usinages.com/attachments/capture-jpg.368605/
Thanks folks for fixing it.
Comment 16 Julien Nabet 2023-11-07 06:41:56 UTC
There’s no specific patch for this so rather WFM