Articles, Blog

LibreOffice Base (15) Embedding a Picture

I’ve made a copy of odb14 form properties and renamed this copy to odb15 embedding pictures. I’ve taken some
pictures of my employees and I want the pictures
of the employees to show up when I bring up his or her record to
keep things simple I’ve placed all the photos in a folder and I
did take all these pictures myself so although probably not the best quality
they will work for our database example we’re going to embed these pictures into our database
meaning we want our photo to be stored on the database table so
the first thing I want to do is going to our tables we need to edit this, right click Edit going to add a field at the bottom we will call this employee-picture but we don’t want this to have a type up
text we want this to have a type of image long var binary let’s save this table and save our database now we want to edit our form so I’m going to forms
I’m going to right click and edit the first thing we notice is
something’s wrong here our background is missing that’s because I updated Libra office to version 4.1 and when I did the background from the gallery is
missing let’s go back and open our other form and this is the
background that we created with the form wizard and that one is okay coming back for other form I’m going to go back to the gallery
and re-add the background when I click and
gallery the first thing we noticed is some
arrows so it looks like in LibreOffice version 4.1 they added more themes. we’ve got arrows we’ve got computers, diagrams, finance, so they’ve added quite a bit
more to the gallery. let’s go back to
backgrounds and I had light-sand actually I think was sand
-light this looks like it here sand light I need to right click insert background page and its back and it looks likely that it’s more
backgrounds in here too. I”m going to close the gallery now we’re back to adding a photo to do that I want to come over and click on the more controls inside here if
get two buttons for image one says is image
button the other is image control we want the image control I’m going to click that
coming down to one of the corners and I’m going to drag
this up and will make he available picture size: right here. I’m going to right click and
this to bring up our properties dialog box by clicking control first thing I want
to do is change the name I’m going to call this img employee
picture now I want to go over to the data tab clicking the down- arrow and selecting employee picture.
going back to the General tab a few other changes I want to make are in the background color we’re going
to make this light gray and I’m going to darken up to border
just a little bit by making that gray and one last thing I
want to add is some help text and am going to type in “Right Click to Add a Picture” let’s close
this I’m going to save the form close it save our database in now I’m going to open up our form and here we see we don’t have any
pictures in here yet when I put my arrow over our picture area it says right click to add a picture in
that help text we couldn’t help text all these fields but I just didn’t think of it, at the
time right click to add a picture. I’m going
to right click and it brings up a button “insert
graphics from” I’m going to left click the button and it brings up our pictures our first person in is Brian Adams so I will click the picture open and the picture gets added. let’s go to our
next record Patricia Anderson and go in and to our picture area right click in insert
graphic from Patricia Anderson open adding one more third record in We’ve got david Browne so that’s how we insert in embedded
picture I get three of them out there I’m going
to save this record going to close the form now I’m going to save as the entire database with
the same name but I’m calling this backup one. Now I’m going to close the database and reopen odb15 embeded pictures opening up the form. Now I’m going to add in our next three
pictures and we’ve got nancy clark Betty Garcia now I’m adding these in, just a few at a
time because when I tried to add too many
pictures at one time my database crashed and it wiped out the entire table. the we have found at
all these in is to add them two or three at a time
and you can in bed are you pictures. I’ve
added all the pictures I have, not every
employee has a picture but most do and I’m showing
that we can add multiple pictures without
crashing the database but remember how I did it I made backups
every few pictures here we see, we meet a copy of odb14 form properties which was 63 kilobytes the we added our first three pictures
and we made a backup he became 6,000 kilobytes and I kept making backups then closing and reopening our database, until I got up to what we
have here with the forty thousand kilobytes so our file
size: is quite large I know most if you’re
thinking will get plenty of disk space it’s not a
problem the problem becomes when we open in close our table we don’t seem much difference right here going back and forth between
the records closing the form shouldn’t be a problem but here even though we didn’t make any
changes just closing the database will take a lot more time than we’re used to
seeing so you need to have a little more patience when you’re working with files have this
size all all cool


  1. postman1372 Author

    The Frugal Computer Guy,

    As I mentioned before I find you tutorials very useful!

    I was wondering if you could create a tutorial regarding the queries and reports used to create things like invoices? I'm having trouble getting to the next stage.

    I look forward to your next tutorial!
    Thanks for all the excellent work!

  2. postman1372 Author

    one note regarding the photo's:
    Try resizing the photo's to about 300 by 200 pixels. This resolution should be good for the size you require, but the file size and therefore the database file size will be greatly reduced. Unless you are planning on print 8×11 prints of the photos directly from your database.You do not require the images at 2 or 3 million pixels for these small record images.

    hope this helps.

  3. TheFrugalComputerGuy Author

    Hi Postman,
    That’s a great point, in my effort to show how quickly a database size can increase from a few pictures, I failed to mention that reducing the photo size can make embedding pictures a very usable option. More importantly, thanks for giving a reduced photo size suggestion of 300 by 200 pixels. I like specifics, it sure beats the answer ”just make it smaller”.

  4. Max0r847 Author

    I also got it to crash after a 5+ images added in one go. That's a bit disappointing, especially considering to avoid the crash it's required to close and open, which takes much longer the bigger the database is. Is this simply a function of database file size, or does it tend to take longer when the large file size is comprised of images?

  5. Monica CZ Author

    Disculpe, escribo en Español.
    Puedo entender lo que explica, pero me cuesta mucho escribirlo.
    "EXCELENTE SUS EXPLICACIONES"!!!!!! Las utilizo para preparar mis clases.
    Muchas Muchas gracias!!!!

  6. Amaury Havé Author

    Hello FrugalcomputerGuy ! Thanks for the video !

    I have a little question about the pictures : how can we export them, in the cases they are stored inside the database and we want to get them back ?

    Maybe the question comes quite late btw ^^'.

  7. Yhanii Somoso Author

    hey @TheFrugalComputerGuy I've been trying this for like a hundred times. I saved it just like how you saved in the form and in the libre office. but whenever I exit the libre office and open my saved file just like yours, ummmm the data suddenly just vanished. I mean also the records inside the table were gone. hope you can help me


Leave a Comment

Your email address will not be published. Required fields are marked *