Calc: Convert Image URLs To Actual Images - sometimes it doesn't work

Hello, in Calc I use a VBA script or Links to images extension that converts a web URL with an image and displays this image directly in the cell. Most of the URLs will be converted to an image, but the ones I send in the attached file below will not. It does not work even in Excel 2016 and 2021 through the same VBA script. However, when I installed the Kutools add-in in Excel, this function works without problems on all URLs, but I don’t want to pay for Kutools when it will work in Calc. I found that when I open the given URL in the browser and then run the VBA script in Excel, the given image is displayed in Excel. But I won’t do it this way because I have thousands of images and I would like it to work in Calc. Where could be the problem? Thank you.
URLs.ods (14.9 KB)

As for the generation speed, I will clarify one thing that I think is quite important. Generating images is much faster if you only have URLs in the sheet from which you need to generate an image. I had various columns in the sheet, including a column with links to individual product pages, and thus the VBA script / extension tried to generate an image from such link, which took time, and the document was horribly slow to scroll and edit when finished.

The URLs in your sample produce this HTML response in versions 7.3 and newer:

warn:ucb.ucp.webdav:18696:6104:ucb/source/ucp/webdav-curl/webdavcontent.cxx:4139: OPTIONS - SC_BAD_REQUEST or SC_INTERNAL_SERVER_ERROR for URL <https://image.shopmoment.com/general/Moment-Benro-A3883TS6PRO-Benro-Aero6-Pro-Travel-Video-Tripod-Aluminum-thumbnail.jpg>, HTTP error: 400, '
OPTIONS
=>
HTTP/1.1 400 Bad Request'

In version 7.2, i.e. before changing our WebDAV/HTTP library to libcurl, these links get replaced fine. So it is very likely a matter of the server rejecting the HTTP request’s UserAgent for some reason, like in tdf#146460 and tdf#148429.

You might want to file a respective bug report. Using the older version would be a workaround until your reported bug is fixed. However, as you mention, even MS Office has trouble with these URLs, so it might very well be NOTOURBUG, and simply an overly restrictive web server policy, which should not be workarounded to not break the terms on which they provide their content.

EDIT: filed tdf#153210.

1 Like

Thanks for your help and for filling out the bug report! It works as you write in the older version, so I will use it for now.