Dynamic image management

I have this question about inserting photos into a database.

Currently, I have chosen to create a Text [VARCHAR] type field in a table to insert the link of the Image file stored on my hard disk in a folder provided for this purpose. It works very well. The folder of these images takes up some disk space.

I also know that I could have chosen to simply copy and paste the image file directly into the DB in an Image type field. The downside is that the DB takes up much more disk space.

My question is: is it possible to simply refer to an internet link corresponding to the image I want to use without having to import it into the DB or download it to a hard disk? To summarize, make the display of the image dynamic so that the DB knowing the reference automatically displays the referenced image in a field provided for this purpose when a record of a form is displayed. The result would be that there is no longer any need to download an image and space is freed up, even if it’s not a lot.

To answer such a question, edit it to mention OS name and LO version as the answer may be very OS-specific. Depending on the OS, recording A URL may be sufficient and you’ll have to call the OS-function to display the image.

Hi ajlittoz,

Ok, the OS is Windows 11 Home, it is up to date. LO is version 7.3.4.2 x64 and the browser generally used is Firefox.

No experience with Windows Under Linux or MacOS, URIs are integrated into the file system so that opening http://… ends up the same as file:///…

But if your display device is Firefox, you have to insert a <img src="<uri>" …> in the code emitted for the page. Since this is HTML, it is independent of the OS.

Note that some sites may refuse to download the image if they detect the request does not come from one of their pages. This is one of IP-protection tricks. Also, such request may sometimes be considered XSS. So experiment.

Thanks for the information @ajlittoz!

See this answer by @Ratslinger.
You can specify a http(s) link in the link field instead of a link to a file, for example:

https://ask.libreoffice.org/uploads/asklibo/original/1X/1eec1ce28d4605f25e751aea59dbef2bc0782151.png
2 Likes