Bug 160092 - Add IMAGE function for Calc formulas
Summary: Add IMAGE function for Calc formulas
Status: RESOLVED DUPLICATE of bug 129129
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
3.3.0 release
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-07 22:02 UTC by Torben
Modified: 2024-03-08 03:22 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 Torben 2024-03-07 22:02:10 UTC
Description:
Microsoft Excel and apparently also Google Docs support the IMAGE function in formulas to load an image from an URL and insert it inside a cell.

=IMAGE(source, [alt_text], [sizing], [height], [width])

Further details can be found on [Microsoft's reference page for the IMAGE function](https://support.microsoft.com/en-gb/office/image-function-7e112975-5e52-4f2a-b9da-1d913d51f5d5).

I recently stumbled about the missing IMAGE function in Calc, when I tried to open a spreadsheet, which used the function to show dynamically generated QR-Codes based on the content of a cell. Here is the formula:

=image("https://quickchart.io/qr?text=" & ENCODEURL(J4))

A quick research revealed that other persons had similar issues or at least required a similar functionality, so there definitely seem to be use-cases where such a function would be helpful:

* https://ask.libreoffice.org/t/feature-request-insert-images-into-calc-cells/6822
* https://ask.libreoffice.org/t/in-calc-is-there-a-way-to-set-the-source-of-an-image-using-a-formula/26652
* https://ask.libreoffice.org/t/macro-to-display-an-image-by-cell-value/75886

The latter two discussions also include examples for macros that resemble at least parts of the required functionality, therefore I assume that the implementation should be feasible.

A macro might be even an acceptable workaround for the time being, but in the end it would be awesome, if Calc could provide a native IMAGE function. Not only to offer Calc users a new feature to enhance their spreadsheets, but primarily to allow correct handling of Excel and Google spreadsheets that use this function.

Steps to Reproduce:
n/a

Actual Results:
n/a

Expected Results:
n/a


Reproducible: Always


User Profile Reset: No

Additional Info:
n/a
Comment 1 ady 2024-03-08 03:07:20 UTC
For the IMAGE() function to be available, several items are needed first.

* The IMAGE() function is supported in Excel 365 / for the web / online. AFAIK, it is not (yet?) supported in any traditional Desktop version.

* Several new error types need to be supported.

* Considering the aforementioned conditions, probably there are additional requirements (dynamic arrays? Any other error type that was introduced in newer versions of Excel? Who knows).

Link for Google Sheets' IMAGE() function:
<https://support.google.com/docs/answer/3093333>

ATM I am reluctant to add tdf#150900 "(Excel-Functions) - [META] Excel Functions" to the Block field, as I am not even sure that would be the adequate meta, considering that Desktop versions of Excel don't seem to support this yet (so it would seem this comes originally from GSheets rather than from MSO – just a hunch/guess).
Comment 2 m_a_riosv 2024-03-08 03:22:15 UTC

*** This bug has been marked as a duplicate of bug 129129 ***