Bug 148426 - Inserting image via clipboard or drag and drop inserts only placeholder
Summary: Inserting image via clipboard or drag and drop inserts only placeholder
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
7.3.2.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:7.4.0 target:7.3.4
Keywords: bibisected, bisected, regression
: 147272 (view as bug list)
Depends on:
Blocks: Clipboard WebDAV
  Show dependency treegraph
 
Reported: 2022-04-06 12:42 UTC by Gerhard Weydt
Modified: 2022-05-04 14:35 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments
Example showing correct and wrong behaviour (9.12 KB, application/pdf)
2022-04-06 12:42 UTC, Gerhard Weydt
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gerhard Weydt 2022-04-06 12:42:01 UTC
Created attachment 179358 [details]
Example showing correct and wrong behaviour

This problem occurs only with some websites, so it must be connected with the way the images are put into the web page. But in LibO 7.2 it works correctly with the same webpages, so there must have been a cange in version 7.3. 

Steps to reproduce:
I use two websites chosen by chance, one of a German broadcasting company, the other of a political magazine.
1. Open the page https://www.ndr.de/
2. Select an image and some text (or only the image)
3. Copy to a writer or Calc document via the clipboard or by drag and drop
Result: The text is copied, but instead of the image there is a small image containing a description of it.
4. do the same for www.spiegel.de
Result: the image is copied into the document, too.

The correct behaviour in the second case is also seen for the first site, if I do that in 7.2.
Comment 1 Roman Kuznetsov 2022-04-06 14:22:17 UTC
COnfirm in

Version: 7.4.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 040b3198fde3385e19e7380fdcabae84a0abac9d
CPU threads: 8; OS: Windows 10.0 Build 19043; UI render: Skia/Raster; VCL: win
Locale: ru-RU (ru_RU); UI: en-US
Calc: threaded

but I think the page https://www.ndr.de/ is a bad example because it has a hard layout
Comment 2 Gerhard Weydt 2022-04-06 20:03:53 UTC
*** Bug 147272 has been marked as a duplicate of this bug. ***
Comment 3 Robert Großkopf 2022-04-07 05:46:51 UTC
Works with the same page on LO 7.2.5 and all LO versions before. See bug 147272. So a regression.
Comment 4 raal 2022-04-07 20:41:47 UTC
This seems to have begun at the below commit.
Adding Cc: to Michael Stahl; Could you possibly take a look at this one?
Thanks
 115b11fc60754321653e4f44d88d1b033163c3da is the first bad commit
commit 115b11fc60754321653e4f44d88d1b033163c3da
Author: Jenkins Build User <tdf@pollux.tdf>
Date:   Tue Nov 23 20:19:31 2021 +0100

    source bdef11f5337ecc87556a92693f6b7b5e200eb29e

https://git.libreoffice.org/core/+/bdef11f5337ecc87556a92693f6b7b5e200eb29e
  configure: default to --with-webdav=curl


messages in CLI:
*   Trying 104.64.173.82:443...
* Connected to www.ndr.de (104.64.173.82) port 443 (#0)
* Initializing NSS with certpath: none
* WARNING: failed to load NSS PEM library libnsspem.so. Using OpenSSL PEM certificates will not work.
*  CAfile: none
*  CApath: none
* loaded libnssckbi.so
* ALPN, server accepted to use http/1.1
* SSL connection using TLS_AES_256_GCM_SHA384
* Server certificate:
* subject: CN=www.ndr.de
*  start date: úno 16 06:48:51 2022 GMT
*  expire date: kvě 17 06:48:50 2022 GMT
*  common name: www.ndr.de
*  issuer: CN=R3,O=Let's Encrypt,C=US
> OPTIONS /nachrichten/info/bundestag752_v-contentgross.jpg HTTP/1.1
Host: www.ndr.de
User-Agent: LibreOffice 7.3.0.0 curl/7.79.1 NSS/3.71
Accept: */*
Accept-Encoding: deflate, gzip

* Mark bundle as not supporting multiuse
< HTTP/1.1 500 Internal Server Error
< Server: AkamaiGHost
< Mime-Version: 1.0
< Content-Type: text/html
< Content-Length: 220
< Cache-Control: private, max-age=0
< Expires: Thu, 07 Apr 2022 20:39:26 GMT
< Date: Thu, 07 Apr 2022 20:39:26 GMT
< Connection: keep-alive
< 
* Connection #0 to host www.ndr.de left intact
Comment 5 Michael Stahl (allotropia) 2022-04-19 17:59:43 UTC
sigh ... i could reproduce it the first 2 attempts with www.ndr.de, but now the images are always fetched successfully.

there are 3 OPTIONS requests for the image URL, each answered by "500 Internal Server Error".

in successful case, another GET request follows, but possibly in the failed cases that didn't happen?
Comment 6 Gerhard Weydt 2022-04-19 19:33:32 UTC
(In reply to Michael Stahl (allotropia) from comment #5)
> sigh ... i could reproduce it the first 2 attempts with www.ndr.de, but now
> the images are always fetched successfully.
> 
> there are 3 OPTIONS requests for the image URL, each answered by "500
> Internal Server Error".
> 
> in successful case, another GET request follows, but possibly in the failed
> cases that didn't happen?

Hi Michael,

I can still reproduce the problem, but only in some cases, and I have no idea for the reason.
For some of the images in www.ndr.de there is a shadow image when I drag and drop the image, for others there is none, and for these latter the problem shows. But the difficult situation is that I saw myself those shadow images when dragging, which do not appear any longer now, for the same images!
It seems tom, though, that I can always reproduce the phenomenon if I select some text and image(s) and copy via the clipboard.
Comment 7 Gabor Kelemen (allotropia) 2022-04-29 09:20:55 UTC
I can reproduce this in a debug build under Ubuntu 18.04 , from Firefox and Chromium as well.
Copying some article page like https://www.ndr.de/sport/fussball/FC-St-Paulis-letzte-Chance-gegen-Nuernberg-Burgstaller-verletzt,pauli6976.html
results in empty image frames with A11Y descriptions in them and on the console messages like:

 warn:ucb.ucp.webdav:7909:8802:ucb/source/ucp/webdav-curl/webdavcontent.cxx:4137: OPTIONS - SC_BAD_REQUEST or SC_INTERNAL_SERVER_ERROR for URL <https://www.ndr.de/sport/fussball/werder14152_v-contentgross.jpg>, HTTP error: 500, ''

about each images.
Comment 8 Commit Notification 2022-05-03 12:43:25 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/5801b887629dbd784116ec6878b61bb99e991647

tdf#148426 ucb: webdav-curl: fall-back to GET if OPTIONS status 500

It will be available in 7.4.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 9 Michael Stahl (allotropia) 2022-05-04 09:32:01 UTC
i hope it's fixed for ndr.de, Gabor tested and said it's fixed too
Comment 10 Commit Notification 2022-05-04 14:35:30 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-7-3":

https://git.libreoffice.org/core/commit/5459e6ef2554005ec045b76195ef1ba813a2dd34

tdf#148426 ucb: webdav-curl: fall-back to GET if OPTIONS status 500

It will be available in 7.3.4.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.