Embed Picture to Cell LibreOffice Calc

how can i use it on LO Calc?

Sorry. We shouldn’t depend too much on doubtable “services” (imo).
In addition a video has lots of MiB, probably and watching takes time.
You didn’t even mention for what software (obviously not Calc) the clip was made.
Explaining what’s actually meant by “embed picture” with a few words should be preferred.
If you are talking of something like OLE, you should tell.
Do you know the fact that every inserted (not “embedded”) image has an anchor? (Also the shape hosting an OLE object has.)
Did you go >Insert>Image ?
The default anchoring for images in Calc is To Cell…
If you got a different anchoring, you can change it to To Cell easily via the context (RightClick) menu.
You didn’t tell what version of LibreOffice you are using. (Always do.) If it isn’t too old, it should also offer the options Fit to Cell Size and Anchor>Cell (resize with Cell)
You see: Best you study your new tools a bit, and try this and that, and probably you may even consider to read in a guide. LibreOffice guides are good. Don’t waste your time watching silly videos made by slang speakers for different software.

1 Like

thanks for the warning.
Insert Image, setting the “Anchor” all works. but,
Can I enter a formula to an image like “Lookup” in Libre Calc?
if “yes” How?

Sorry. I simply don’t understand.

i can not explain it with a few words, so i show it with a video. thanks.

To my knowledge there is no function with has a picture as “returned value”. So you can’t write =PIC(“path to .jpg”)

One problem is: The picture is not IN the cell, but only anchored at cell, page etc. I remember from older versions much trouble when inserting rows, or pictures not “fitting” in cells. (One solution was to embed pictures in comments…)
Therefore I don’t use this feature, even as I read this is working better now.

You may write /use a macro to embedd a picture, but the value of the cell will be different - could be set to the path, but with macros choice is up to the programmer.

Functions (also UDF) can only return an unformatted text (String) or a number (Double).
Some standard functions (or simple assignment formulas) have special little side-effects.
UD functions generally also can have side-effects, but not every kind of.
To find a shape (hosting an image e.g.) by name, to set its .Anchor to a specified cell (in the same sheet where the image was ancored previously), to manipulate its properties (including visisbility) … are allowed side-effects (Currently? I tested with V 7.2.0.4).
To write code based on such rarely used features is

  • somehow ticklish. (You won’t easily find detailed information.)
  • probably error-prone. (Due to unexplored bugs e.g.)
  • potentially wasted time. (Because used features may be changed when development goes on.)

Since mailmerge is evil anyway, you may nonetheless give the idea a try.
My code used for testing can’t be “released”, and I probably may not be able to soon give a better basis for your (OQ’s) special development. Sorry.

I found a use for this today - generating QR codes with a web API.
An IMAGE formula that returns an image from a path parameter, with optional parameters eg size, can concatenate the API and target URLs and return a QR code.
Like this =IMAGE(“API URL?data=”&A1,[size],[other params])
I was just coming back from China today, where you use 100 QR codes a day in normal life, so it’s a totally legitimate use case.
It sounds like it would be a big job for LO to allow formulas to return other data types than what it does already, but this is available in both popular competitors, Excel and Google so worth it maybe?

But to show a QR code it is not necessary to return it as result of a function. Actually it is not even necessary to store the image, it will be generated “on the fly” to be shown on screen.

Since you refuse to tell any details, I assume you have a list of mail merge receipients including Forename, Surname, Address, Zip, City plus some Picture which can be different for each receipient.
Firstly, there is no way to include pictures in mail merge documents. Mail merge fields include nothing but text, numbers, dates etc.
However, a database report can do this.
Do NOT store any pictures in spreadshees. Store them in a dedicated directory and then store the file names in your address list.
The mail merge wizard will create a database document anyway when it generates a mail merge from spreasheet. The database document will be connected to your spreadsheet. Now you can add a query to that database which concatenates the path with the picture file names. Finally a report can show the addresses and pictures together with additional content. The output of a report is similar to a mail merge document.

Download and unizp the archive, open the database document.
Notice the status bar of this document which indicates that the actual source of data is a spreadsheet.
Select the Queries section.
Right-click the query >Edit in SQL View… which shows something like a “formula”.
Replace the part within single quotes ‘file:///tmp/test/pics’ with the actual picture path of your copy, for instance ‘file:///C:/MySelf/Downloads/pics/’ (with trailing slash).
Save and close the query. Save the embedding database.
Select the Reports section and open the report.

1 Like

Thanks for the Help,

I had never opened Base before your instructions, so please forgive me my ignorance @Villeroy

You wrote

But when I select Queries I do not see “Edit in SQL View”, see screenshot

The folder Pics, Database.odb & Source.ods are all in the folder E:\Training\LibreOffice\PicDB.
Do you have any idea what goes wrong?

Thank you very much in advance.

Indeed, it is in the context menu and in the Edit menu.

I’m sorry, but which context menu do you mean @Villeroy ?
In the Edit menu the option is greyed out:
%t20231004174248

It will be in the context menu of the query, after it was created by

Create query in SQL-mode

… seen in the screenshot above. No query, no context menu.
.
But now the next question is, why there is no query in your file…

I have no idea @Wanderer
As I’ve stated before, I had never opened Base before this.
I have worked a little bit with Access in the past, but that’s at least 20 years ago.
.
I’ve followed Villeroy’s instructions.

Notice the status bar of this document which indicates that the actual source of data is a spreadsheet.

As you can see in the screenshot it says:
E:\Training\LibreOffice\PicDB\Source.ods
.
So, I don’t know what’s going wrong.
Yesterday I updated LO to the latest version.
.
Version: 7.6.2.1 (X86_64) / LibreOffice Community
Build ID: 56f7684011345957bbf33a7ee678afaf4d2ba333
CPU threads: 8; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: en-CA (en_NL); UI: en-GB
Calc: CL threaded

i’m going to mail merge the picture/image from LO Calc. that is why I need the solution.

Don’t use the 'Answer’opption fo “comments-in-return”.

ok, sorry i’m new here